GNU bug report logs -
#66117
30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Wed, 20 Sep 2023 08:53:02 UTC
Severity: minor
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 30 Dec 2023 15:24:04 +0200
with message-id <83a5pr4ydn.fsf <at> gnu.org>
and subject line Re: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
has caused the debbugs.gnu.org bug report #66117,
regarding 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
66117: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
X-Debbugs-CC: Dmitry Gutov <dmitry <at> gutov.dev>
Hello,
Background: Some Org users (especially org-roam users) often complain
that Org agenda is very slow (sometimes, tens of seconds or minutes)
when running it right after startup. The cause is often not Org agenda
itself, but Emacs opening files slowly.
In some cases, the main reason files are opened slowly is user-defined
hooks or various packages adding advices mindlessly. However, Emacs
itself is also taking a significant fraction of time when opening a
large number of buffers.
I have recently got data on opening a large number of Org files in
Emacs that clearly demonstrates that `file-buffer-visiting' (and thus
`find-file') scale poorly when the number of buffers increases. This is
especially clear when Org mode needs to open several hundreds of
not-yet-opened Org files in a new Emacs session.
In the attached profile, ~500 Org buffers are being opened and calls to
`find-buffer-visiting' take 12.4 sec out of total 30.9 sec - 1/3 of all
the execution time. After replacing some of the calls to
`find-buffer-visiting' with `get-file-buffer', the total execution time
decreased to ~20 sec, confirming that `find-buffer-visiting' is
contributing significantly to slow performance.
Would it be possible to implement some kind of caching mechanism to be
used by `find-buffer-visiting'?
[org_agenda_profile_2 (application/octet-stream, attachment)]
[Message part 5 (text/plain, inline)]
In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.17.8) of 2023-09-19 built on localhost
Repository revision: 6721c616653279913f51f211b80614bff82c24c3
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Gentoo Linux
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
[Message part 6 (message/rfc822, inline)]
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: monnier <at> iro.umontreal.ca, dmitry <at> gutov.dev, 66117 <at> debbugs.gnu.org
> Date: Sat, 30 Dec 2023 12:51:09 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Should we now close this bug?
>
> Yes, I think. I hope that closing the bug will not make question to
> Stefan (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#373) fall
> through the cracks.
Thanks, closing.
This bug report was last modified 1 year and 135 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.