GNU bug report logs - #78665
31.0.50; Very slow saves

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sun, 1 Jun 2025 20:08:03 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#78665: closed (Re: bug#78665: 31.0.50; Very slow saves)
Date: Wed, 04 Jun 2025 20:41:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#78665: 31.0.50; Very slow saves

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 78665 <at> debbugs.gnu.org.

-- 
78665: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78665
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> linkov.net>
Cc: 78673-done <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Jonas Bernoulli <jonas <at> bernoul.li>, 78665-done <at> debbugs.gnu.org
Subject: Re: bug#78665: 31.0.50; Very slow saves
Date: Wed, 04 Jun 2025 16:40:36 -0400
> I've completed testing your patch and found no problems.

Thanks, pushed to `master`,


        Stefan


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Very slow saves
Date: Sun, 01 Jun 2025 16:06:53 -0400
Package: Emacs
Version: 31.0.50


The last few weeks I noticed that saving a buffer was sometimes taking
a very long time (like more than 10s).  I finally managed to catch it
in the act while running the profiler, and it seems to have something to
do with `outline--hidden-headings-restore-paths`:

        9630  75% - command-execute
        9630  75%  - call-interactively
        8638  67%   - funcall-interactively
        8630  67%    - save-buffer
        8630  67%     - basic-save-buffer
        8607  67%      - run-hooks
        8607  67%       - vc-git-resolve-when-done
        8593  67%        - vc-resynch-buffer
        8593  67%         - vc-resynch-window
        8593  67%          - vc-revert-buffer-internal
        8593  67%           - revert-buffer
        8353  65%            - mapc
        8353  65%             - funcall
        8353  65%              - #<byte-code-function 1FB>
        8353  65%               - outline--hidden-headings-restore-paths
        8353  65%                - outline-map-region
        7748  60%                 - #<byte-code-function 28A>
        7732  60%                  - outline-hide-subtree
        7728  60%                   - outline-flag-subtree
        4268  33%                    + outline-back-to-heading
        3393  26%                    + outline-end-of-subtree
          63   0%                    + outline-flag-region
           4   0%                    + outline-end-of-heading
           8   0%                  + mapcar
           4   0%                    gethash
           4   0%                    pos-bol
         605   4%                 + outline-next-heading
         232   1%            + run-hook-wrapped
           8   0%            + revert-buffer--default
          14   0%          re-search-forward
          16   0%      + basic-save-buffer-1
           4   0%      + vc-before-save
           3   0%      + vc-after-save
           8   0%    + execute-extended-command
         992   7%   + byte-code
        1855  14% + redisplay_internal (C function)
        1166   9% + #<byte-code-function 6A0>
          45   0% + timer-event-handler
           4   0% + jit-lock--antiblink-post-command
           4   0% + reveal-post-command
           0   0%   ...

This one occurred while saving `transient.el`.

Maybe we could avoid the whole thing by changing VC to not
`revert-buffer` (AFAIK this was done to handle the case where CVS/RCS
would update the "keywords" in the file to reflect its new state, but
I believe this is basically never done nowadays).

But in any case `outline--hidden-headings-restore-paths` just takes too
much time.


        Stefan




This bug report was last modified 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.