GNU bug report logs -
#48264
28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
When changing the default for a Lisp variable defined in the C source
with the DEFVAR_PER_BUFFER macro, whether by let or by set-default, it
takes time proportional to the number of currently live buffers.
Note, DEFVAR_PER_BUFFER variables are stored as Lisp_Object fields in
struct buffer.
The cause of the pathological performance is that setting a default for
a DEFVAR_PER_BUFFER variable iterates over every struct buffer (that
doesn't already have a binding) to set the field corresponding to the
variable.
This is because accessing a DEFVAR_PER_BUFFER variable is done purely by
looking at the current buffer, even if the buffer doesn't have a local
binding for the variable.
This issue was previously reported in bug#41029 and noticed as part of
several other bugs.
I have a patch series which fixes this issue by making DEFVAR_PER_BUFFER
variable accesses fall back to the default if there's no local binding
for the variable, which I'll send shortly as a followup.
This bug report was last modified 2 years and 290 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.