[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43016: replace-region-contents takes a lot of time when called from
From: |
Eli Zaretskii |
Subject: |
bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer |
Date: |
Mon, 24 Aug 2020 22:36:03 +0300 |
> From: Tassilo Horn <tsdh@gnu.org>
> Cc: laszlomail@protonmail.com, 43016@debbugs.gnu.org, eggert@cs.ucla.edu
> Date: Mon, 24 Aug 2020 21:15:42 +0200
>
> ljell is right, it seems to have to do with the non-ASCII characters.
> In my sample.json.gz from above, I've just replaced every "e" with an
> "Ê" (except in true/false literals). When I prettify that, it aborts
> early (fast) just after 449 early_abort_tests.
>
> So just replacing "e" with an "Ê" changed "compares in time with 300.000
> early_abort_tests" to "doesn't compare in time and makes only 449
> early_abort_tests in that time". The only difference to ljell's test
> file is that with mine, there doesn't seem to be a big gap between the
> last early_abort_test returning false and the one returning true.
I guess it's somehow related to the fact that buffer_chars_equal is
optimized for pure-ASCII buffers, see how we compute a_unibyte and
b_unibyte members of the context struct.
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, ljell, 2020/08/24
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, Paul Eggert, 2020/08/24
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, Eli Zaretskii, 2020/08/25
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, Paul Eggert, 2020/08/25
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, Tassilo Horn, 2020/08/25
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, Paul Eggert, 2020/08/25
- bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer, ljell, 2020/08/24