bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large nu


From: Stefan Monnier
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Thu, 14 Dec 2023 14:36:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>>>>> It won't be buffer-local-if-changed, so binding it will not be costly.
>>>> As mentioned elsewhere in this bug-report we can make `case-fold-search`
>>>> into a `DEFVAR_LISP`: it would have no visible impact to ELisp and would
>>>> avoid the costly let-bindings.
>>> Wouldn't DEFVAR_LISP break major modes that do (setq case-fold-search ...)?
>>
>> No, it makes no difference to Lisp.  It only changes the implementation
>> strategy: DEFVAR_LISP stores the value in a global C variable (which
>> thus requires more processing when the var is buffer-local, more
>> specifically updating the C var when we `set-buffer`), whereas
>> DEFVAR_PER_BUFFER stores the value inside the buffer object (which
>> thus requires more processing when the var is *not* buffer-local since
>> the global value is duplicated in all the buffers where it's not made
>> buffer-local).
>
> Do I understand correctly that what is needed to implement your
> suggestion is
>
> 1. Remove case_fold_search_ slot from buffer objects
> 2. Use DEFVAR_LISP for case-fold-search
> 3. Declare case-fold-search buffer-local
> 4. Replace BVAR(...) references in C with Vcase_fold_search

Yes (assuming that 3 refers to the use of `make-variable-buffer-local`).


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]