emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Christopher M. Miles" <numbchild@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [BUG] kill-buffer invoked org-persistent-write-all-buffer caused Emacs long suspend
Date: Thu, 28 Oct 2021 21:58:09 +0800	[thread overview]
Message-ID: <DB9PR08MB66336CDF0F43DE3DB1D08649A3869@DB9PR08MB6633.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <874k918jfe.fsf@localhost>


[-- Attachment #1.1: Type: text/plain, Size: 4466 bytes --]



Ihor Radchenko <yantar92@gmail.com> writes:

> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> Here is the profiler report:
>>
>> CPU:
>>
>> #+begin_example
>>         4003  66% - command-execute
>>         4003  66%  - call-interactively
>>         3913  65%   - funcall-interactively
>>         3320  55%    - kill-buffer
>>         3318  55%     - org-persist-write-all-buffer
>>         3318  55%      - org-persist-write-all
>
> Sorry for this. Should be already fixed by 5abd149cf. Are you on latest
> main?
>
> Best,
> Ihor

Thanks for quick patch, I'm on the latest main. and I pulled your patch. Now it's not infinite
looping, but still takes about 3.5 seconds. So I take another profiler profiling again.

CPU

#+begin_example
        4824  88% - command-execute
        4824  88%  - call-interactively
        4797  87%   - funcall-interactively
        4313  78%    - kill-buffer
        4310  78%     - org-persist-write-all-buffer
        4310  78%      - org-persist-write-all
        4310  78%       - if
        4310  78%        - let
        4310  78%         - while
        4310  78%          - let
        4310  78%           - if
        4310  78%            - progn
        4310  78%             - org-persist-write
        4310  78%              - if
        4310  78%               - save-current-buffer
        4310  78%                - let
        3903  71%                 - let
        3903  71%                  - if
        3903  71%                   - if
        3858  70%                    - progn
        3858  70%                     - let
        3380  61%                      - unwind-protect
        3380  61%                       - prog1
        3380  61%                        - save-current-buffer
         103   1%                         + write-region
         390   7%                      + let
          88   1%                        if
         405   7%                 + org-persist--get-index
           2   0%                 + setq
           1   0%     + auto-revert-notify-rm-watch
           1   0%     + valign--maybe-clean-advice
           1   0%     + recentf-track-closed-file
         484   8%    + counsel-M-x
          27   0%   + ivy-completing-read
         642  11% - ...
         642  11%    Automatic GC
           1   0% + global-font-lock-mode-check-buffers
           1   0% + redisplay_internal (C function)

#+end_example

Memory:

#+begin_example
  4,155,608,836  99% - command-execute
  4,155,608,836  99%  - call-interactively
  4,155,381,887  99%   - funcall-interactively
  4,151,008,326  99%    - kill-buffer
  4,151,002,497  99%     - org-persist-write-all-buffer
  4,151,002,497  99%      - org-persist-write-all
  4,151,002,497  99%       - if
  4,151,002,497  99%        - let
  4,151,002,497  99%         - while
  4,151,002,497  99%          - let
  4,151,002,497  99%           - if
  4,150,994,313  99%            - progn
  4,150,994,313  99%             - org-persist-write
  4,150,994,313  99%              - if
  4,150,994,313  99%               - save-current-buffer
  4,150,994,313  99%                - let
  4,140,546,179  99%                 - let
  4,140,546,179  99%                  - if
  4,140,546,179  99%                   - if
  4,140,540,035  99%                    - progn
  4,140,540,035  99%                     - let
  3,879,416,903  93%                      - unwind-protect
  3,879,416,903  93%                       - prog1
  3,879,416,903  93%                        - save-current-buffer
     20,391,917   0%                         - write-region
     20,165,663   0%                          + select-safe-coding-system
        226,254   0%                          + make-lock-file-name
        256,994   0%                         + prin1
    260,984,307   6%                      + let
        122,760   0%                      + if
         16,065   0%                        generate-new-buffer
      7,942,223   0%                 + org-persist--get-index
      2,505,911   0%                 + setq
          8,184   0%            + or
          3,072   0%     + tramp-flush-file-function
          1,120   0%     + preview-kill-buffer-cleanup
          1,024   0%     + save-place-to-alist
            613   0%     + replace-buffer-in-windows
      4,373,561   0%    + counsel-M-x
        226,949   0%   + ivy-completing-read
         65,528   0% + ...
         20,692   0% + redisplay_internal (C function)

#+end_example


[-- Attachment #1.2: Type: text/html, Size: 5690 bytes --]

[-- Attachment #2: Type: text/plain, Size: 282 bytes --]


<#secure method=pgpmime mode=sign>
-- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

  reply	other threads:[~2021-10-28 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 11:28 [BUG] kill-buffer invoked org-persistent-write-all-buffer caused Emacs long suspend Christopher M. Miles
2021-10-28 11:42 ` Ihor Radchenko
2021-10-28 13:58   ` Christopher M. Miles [this message]
2021-10-28 14:40     ` Ihor Radchenko
2021-10-28 15:57       ` [SOLVED] " Christopher M. Miles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB9PR08MB66336CDF0F43DE3DB1D08649A3869@DB9PR08MB6633.eurprd08.prod.outlook.com \
    --to=numbchild@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).