Subject: Re: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers

From: Stefan Monnier <[email-masked]>
Date: Sun, 17 Dec 2023 10:17:40 -0500

> I'm talking specifically about any changes from previous behavior
> visible from Lisp.  I think we should test all of the following:
>
>   default-value
>   default-boundp
>   setq-default
>   default-toplevel-value
>   set-default-toplevel-value
>
> and make sure they all behave exactly the same, both in and out of a
> let-binding.

There should be absolutely no change visible using any combination of
the above function (including with the addition of `let`).

If there is, it's a bug in our C code (I don't know of such bugs, but
given the complexity of the code and its past history of a long litany
of bugs, I definitely won't vouch for it).

Some DEFVAR_PER_BUFFER variables *do* behave differently from normal
DEFVAR_LISP, but these are the "always buffer-local" ones, like
`mode-name`, `buffer-file-name`, etc...

Most of the DEFVAR_PER_BUFFER variables behave just like any
normal variable.  They just use a different implementation strategy and
the C code works hard to hide that difference.

        Stefan