[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ido-switch-buffer is slow with many buffers; others are fast
From: |
sbaugh |
Subject: |
Re: ido-switch-buffer is slow with many buffers; others are fast |
Date: |
Sat, 14 Nov 2020 15:06:57 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
> With current processing power, I find it strange that filtering with
> a single regexp on a 1000-element list should take a whole second.
> IOW, I suspect that there's more to it than that (e.g. an
> inefficient regexp, or some other cost somewhere).
Ah, you're right. After more investigation, it seems to be that
string-match is extremely inefficient for me for some
reason. Specifically, if case-fold-search is buffer-local or set with
let, (string-match "" "") is about 2000x slower (not exaggeration) than
if case-fold-search is global. (Doesn't matter what case-fold-search is
set to.)
That is,
(setq-default case-fold-search t) (benchmark-run 1000 (string-match "" ""))
is about 2000x faster than
(benchmark-run 1000 (let ((case-fold-search t)) (string-match "" "")))
It seems this isn't (directly) related to my configuration, because a
fresh Emacs doesn't have the issue. Instead, it's something about my
running, 1000-buffer Emacs... not sure what would cause this or how to
fix it.
- ido-switch-buffer is slow with many buffers; others are fast, catern, 2020/11/14
- Re: ido-switch-buffer is slow with many buffers; others are fast, Stefan Monnier, 2020/11/14
- Re: ido-switch-buffer is slow with many buffers; others are fast,
sbaugh <=
- Re: ido-switch-buffer is slow with many buffers; others are fast, Dmitry Gutov, 2020/11/14
- Re: ido-switch-buffer is slow with many buffers; others are fast, Spencer Baugh, 2020/11/14
- Re: ido-switch-buffer is slow with many buffers; others are fast, Stefan Monnier, 2020/11/15
- Re: ido-switch-buffer is slow with many buffers; others are fast, Spencer Baugh, 2020/11/15
- Re: ido-switch-buffer is slow with many buffers; others are fast, Arnold Noronha, 2020/11/15
- [PATCH 02/10] Add bset_save_length and use it, Spencer Baugh, 2020/11/19
- [PATCH 04/10] Use bset_enable_multibyte_characters everywhere, Spencer Baugh, 2020/11/19
- [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER (Was: ido-switch-buffer is slow), Spencer Baugh, 2020/11/19
- Re: [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER, Stefan Monnier, 2020/11/19