GNU bug report logs - #66117
30.0.50; `find-buffer-visiting' is slow when opening large number of buffers

Previous Next

Package: emacs;

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

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 66117 <at> debbugs.gnu.org
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Fri, 22 Sep 2023 13:38:53 +0000
Dmitry Gutov <dmitry <at> gutov.dev> writes:

>> However, upon recording the profiler report with that change,
>> `find-buffer-visiting' still took a significant fraction of CPU time.
>> So, I decided to reach out upstream.
>
> Because the rest of the calls are made from Org?

I am not 100% sure what you mean.

> I see this in the profile, though:
>
>          6247  20%        - editorconfig--advice-find-file-noselect
>
> There seems to be a lot of timers in that profile, and this is in one of 
> them (under "Automatic GC" which takes up 53% of the time).
>
> So one was to improve this in the meantime would be to bring it up with 
> "editorconfig" authors. I would even question the wisdom of advising 
> find-file-noselect.

Nope. If you dig deeper, you will see that it is an around advice that
later calls the original `find-file-noselect', where we spend most of
the time:

        6247  20%        - editorconfig--advice-find-file-noselect
        6247  20%         - let
        6247  20%          - let
        6247  20%           - setq
        6247  20%            - apply
        1773   5%             - #<lambda -0xd6e9bb25a48132a>
        1773   5%              - if
        1773   5%               - if
        1773   5%                - let*
        1773   5%                 - and
        1773   5%                  + find-buffer-visiting
        1666   5%             - #<lambda -0xd6e9bb25a48132a>
        1666   5%              - if
        1666   5%               - if
        1666   5%                - let*
        1666   5%                 - and
        1666   5%                  + find-buffer-visiting
        1006   3%             - #<lambda -0xd6e9bb25a48132a>
        1006   3%              - if
        1006   3%               - if
        1006   3%                - let*
        1006   3%                 - if
        1006   3%                  - setq
        1006   3%                   + create-file-buffer
         830   2%             - #<lambda -0xd6e9bb25a48132a>
         830   2%              - if
         830   2%               - if
         830   2%                - let*
         830   2%                 - and
         830   2%                  + find-buffer-visiting
         776   2%             - #<lambda -0xd6e9bb25a48132a>
         776   2%              - if
         776   2%               - if
         776   2%                - let*
         776   2%                 - and
         776   2%                  + find-buffer-visiting

-- 
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>




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.