[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE
From: |
Eli Zaretskii |
Subject: |
bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE |
Date: |
Sat, 04 Apr 2020 20:37:47 +0300 |
> Date: Sat, 04 Apr 2020 20:22:37 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 40407@debbugs.gnu.org
>
> > + if (EQ (dst_object, Qt))
> > + {
> > + /* Fast path for ASCII-only input and an ASCII-compatible coding:
> > + act as identity. */
> > + Lisp_Object attrs = CODING_ID_ATTRS (coding.id);
> > + if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs))
> > + && (STRING_MULTIBYTE (string)
> > + ? (chars == bytes) : string_ascii_p (string)))
> > + return nocopy ? Fcopy_sequence (string) : string;
>
> I think in the use case where we return a copy, we should make sure
> the return value is unibyte when encoding and multibyte when decoding.
> Otherwise, I think this is OK (for the master branch, obviously).
Btw, if we want this particular use case to be as fast as possible,
then Fcopy_sequence is not the best way, because it is not optimized
for the case of copying a single string. We could do better by
calling make_uninit_multibyte/unibyte_string and memcpy directly.
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/03
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/03
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/03
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE,
Eli Zaretskii <=
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/05
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/05
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/05
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Eli Zaretskii, 2020/04/04
- bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE, Mattias Engdegård, 2020/04/04