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

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

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


From: GNU bug Tracking System
Subject: bug#66117: closed (30.0.50; `find-buffer-visiting' is slow when opening large number of buffers)
Date: Sat, 30 Dec 2023 13:25:01 +0000

Your message dated Sat, 30 Dec 2023 15:24:04 +0200
with message-id <83a5pr4ydn.fsf@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@gnu.org.)


-- 
66117: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Wed, 20 Sep 2023 08:53:06 +0000
X-Debbugs-CC: Dmitry Gutov <dmitry@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'?

Attachment: org_agenda_profile_2
Description: Binary data

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>

--- End Message ---
--- Begin Message --- Subject: Re: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Sat, 30 Dec 2023 15:24:04 +0200
> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: monnier@iro.umontreal.ca, dmitry@gutov.dev, 66117@debbugs.gnu.org
> Date: Sat, 30 Dec 2023 12:51:09 +0000
> 
> Eli Zaretskii <eliz@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.


--- End Message ---

reply via email to

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