[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 00/10] Speeding up DEFVAR_PER_BUFFER (Was: ido-switch-buffer is s
From: |
Spencer Baugh |
Subject: |
[PATCH 00/10] Speeding up DEFVAR_PER_BUFFER (Was: ido-switch-buffer is slow) |
Date: |
Thu, 19 Nov 2020 10:38:04 -0500 |
Here is my first attempt at speeding up DEFVAR_PER_BUFFER. I would
greatly appreciate review/comments. This is just a first attempt and
will certainly need some cleanup.
Here is a simple benchmark just for DEFVAR_PER_BUFFER:
(benchmark-run 500000 (let ((case-fold-search nil)) (string-match "" "")))
; unpatched emacs: (0.6872330339999999 0 0.0)
; patched emacs: (0.608068564 0 0.0)
(setq my-buffer-list nil)
(dotimes (idx 1000) (push (get-buffer-create (format "test-buffer:%s" idx))
my-buffer-list))
(benchmark-run 500000 (let ((case-fold-search nil)) (string-match "" "")))
; unpatched emacs: (18.591189848 0 0.0)
; patched emacs: (0.5885462539999999 0 0.0)
There's some measurement noise, but the patch does indeed eliminate
the performance overhead of let-binding DEFVAR_PER_BUFFER when there
are large numbers of buffers. A 40x speedup is not too shabby. :)
The last two patches are the core of the change. Most of the rest of
the patch series is simple preparatory changes for changing the
definition of the BVAR macro.
Spencer Baugh (10):
Take buffer field name in DEFVAR_PER_BUFFER
Add bset_save_length and use it
Use bset_last_selected_window everywhere
Use bset_enable_multibyte_characters everywhere
Add BVAR_DEFAULT for access to buffer defaults
Disallow using BVAR as an lvalue
Reorder buffer.h for upcoming rework of BVAR
Make cache_long_scans buffer-local when setting it
Access buffer_defaults in BVAR if there's no local binding
Don't iterate over all buffers in set_default_internal
src/buffer.c | 243 +++++++++++++++++++-------------------
src/buffer.h | 313 +++++++++++++++++++++++++++----------------------
src/category.h | 2 +-
src/data.c | 30 +----
src/eval.c | 18 ++-
src/fileio.c | 12 +-
src/syntax.h | 2 +-
src/window.c | 5 +-
8 files changed, 320 insertions(+), 305 deletions(-)
--
2.28.0
- Re: ido-switch-buffer is slow with many buffers; others are fast, (continued)
- 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, 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 <=
- Re: [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER, Stefan Monnier, 2020/11/19
- [PATCH v2 00/16] Speeding up DEFVAR_PER_BUFFER, Spencer Baugh, 2020/11/21
- [PATCH v2 01/16] Add a test for let-binding unwinding, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 01/16] Add a test for let-binding unwinding, Stefan Monnier, 2020/11/25
- Re: [PATCH v2 01/16] Add a test for let-binding unwinding, Spencer Baugh, 2020/11/30
- [PATCH v2 05/16] Add BVAR_DEFAULT for access to buffer defaults, Spencer Baugh, 2020/11/21
- [PATCH v2 02/16] Assert not local-variable-p after setq in let_default binding, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 02/16] Assert not local-variable-p after setq in let_default binding, Stefan Monnier, 2020/11/25
- [PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters, Stefan Monnier, 2020/11/25