Subject: Re: bug#31853: 27.0.50; binding case-fold-search is slow when there are many buffers

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Jun 2018 10:53:18 +0300

> From: Aaron Jensen <[email-masked]>
> Date: Sat, 16 Jun 2018 00:39:00 -0700
> Cc: [email-masked]
> 
> > In a session that has 291 buffers, I get 2.8 microseconds, whereas in
> > fresh "emacs -Q", I get 1.5 microseconds.  This is 3 orders of
> > magnitude faster than what you get, and the difference between a large
> > session and a new one is much smaller.
> 
> I think I missed a zero on my original fresh emacs report. The report
> of 1ms per for a long running emacs was correct though.
> These should be accurate:
> On emacs -Q I get 2 microseconds.
> On a newly launched emacs w/ my config I get 3 microseconds with 9
> buffers and 1 killed buffer.
> On an emacs I've been running for a bit I get 40 microseconds with 71
> buffers and 237 killed buffers.

In https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18522#201 I proposed
a change to set-default that would use FOR_EACH_LIVE_BUFFER.  Could
you see if that change helps in your case?