From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eLAsD2GtemFTdwEAgWs5BA (envelope-from ) for ; Thu, 28 Oct 2021 16:02:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AI+7CmGtemGYGQAAbx9fmQ (envelope-from ) for ; Thu, 28 Oct 2021 14:02:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5C36731912 for ; Thu, 28 Oct 2021 16:02:07 +0200 (CEST) Received: from localhost ([::1]:49992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mg5yo-0002av-CG for larch@yhetil.org; Thu, 28 Oct 2021 10:02:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg5wk-0002aj-Cn for emacs-orgmode@gnu.org; Thu, 28 Oct 2021 09:59:58 -0400 Received: from mail-oln040092064030.outbound.protection.outlook.com ([40.92.64.30]:61215 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg5wc-0004uR-F8 for emacs-orgmode@gnu.org; Thu, 28 Oct 2021 09:59:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Al0bMh3ihAqIv5npi7lepew/Sx+PdM6089D8E+96L+8jP1AFTEJFWn30wPIEr/TjG51fruGGpLNewmMzv9Lx4HH881KLVkrSwCIfhgghYsmcnu2IRUHKIm2nSgrI8eLEyWqHEmrP2A5bAOYkjQn4b9lnlf7v7+cqVqs/ml8VpD8HuKqxuKsQsbdbeOd3dXEmGoqxbLGx6daZy5+9YKtDJ7N2F6rNpwaU7k7kJSlAKqf7fMoz1boragh0SZQvrCYd3jh8f76sTsaMgNcJpLtt4WCOtvQhLJN5x16M5IEBeogTon2AdlbCwTSMLuXqPp1BbvM2/uByux5J+mMVkWamwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=992jwg0XzmIETdukrHtcM+qJXqXKDgAdfxvEn+ewOn8=; b=KcdJjb1z+14zKN+205NRuBPRgMjqb7PFNdREpZHj9eRENA67yTUB4CMkW5PfBs7NBeszO1cR0N6gaIj0VWbhzvvV2mPZnpBd5K+AKo/kec9t/no0GJBwCNJxev1JSUMB9W0imHEgseTQxFypFfoap9Eq2jJ727OwnQtwPQzE8a13GGfnYoiHrAhuxHWmkdZYcWAu5Okl+i2GaUacCP0T1ZAmM1+LP7GJSkuGjIkMtzAjdPtcf76TNXiExh2ekC9ybq58t2Ela8FAU//2hGrGBt9qVXY5//flzKAKLyhzl9JFDLjcX2oXonW7kj5LSUpvtytQgYYvZcAFIVUL3yEn+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=992jwg0XzmIETdukrHtcM+qJXqXKDgAdfxvEn+ewOn8=; b=sT+jQTrJfZ0ocE1tkW7J8oqLAjerD/nSUP+km9tiXLG9T/N1hXj7dSyE7CroQZXeMLUFG81g9wQNYW8YQiQZ289k7OlxD1D5K7Q5hM78XQsB9u2TlkK6KtJEjXuuGRb1h2Dv7V8458IPmvQhPDH0E1G3SXDH4kKhsAETKiKRTS42YFGn1q36RhuTGRmuNoRt+eGlCZm9BTv0E/sV8CeDk26dVb58IenpxbH1MHqIo+MhxodTr7SUpHaozC09TPx2zwlqhjglr7kSEiS6f8afzbycLLtIpo8ZE0Kug+fCWSS11CXp316Wx4aPhBCSXsmQrA3+3zpk+hIgVieqHqjS+A== Received: from DB9PR08MB6633.eurprd08.prod.outlook.com (2603:10a6:10:23d::6) by DB6PR0802MB2583.eurprd08.prod.outlook.com (2603:10a6:4:99::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Thu, 28 Oct 2021 13:59:47 +0000 Received: from DB9PR08MB6633.eurprd08.prod.outlook.com ([fe80::e05b:844:b3fe:32c4]) by DB9PR08MB6633.eurprd08.prod.outlook.com ([fe80::e05b:844:b3fe:32c4%5]) with mapi id 15.20.4628.020; Thu, 28 Oct 2021 13:59:47 +0000 References: <874k918jfe.fsf@localhost> User-agent: mu4e 1.7.0; emacs 28.0.60 From: "Christopher M. Miles" To: Ihor Radchenko Subject: Re: [BUG] kill-buffer invoked org-persistent-write-all-buffer caused Emacs long suspend Date: Thu, 28 Oct 2021 21:58:09 +0800 In-reply-to: <874k918jfe.fsf@localhost> Message-ID: Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [hLFTiE7XPN9Fe0gvGeZ2TiN8JEF4GOwE] X-ClientProxiedBy: HKAPR03CA0006.apcprd03.prod.outlook.com (2603:1096:203:c8::11) To DB9PR08MB6633.eurprd08.prod.outlook.com (2603:10a6:10:23d::6) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 Received: from Mac-mini.local (183.246.144.93) by HKAPR03CA0006.apcprd03.prod.outlook.com (2603:1096:203:c8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13 via Frontend Transport; Thu, 28 Oct 2021 13:59:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d796d85d-99f0-45a0-7259-08d99a1b337a X-MS-TrafficTypeDiagnostic: DB6PR0802MB2583: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wUDJI+YkFyy8HJO4dyXbzzbP5lQAgaphiIQeg2m+HU3GKH7kl6cnK8SyO8iMkf37fCkm9F5WbcpuJNT3TJq8OZNN6uQqJKSxVLVfocSp/u4qehN1Se3DfUpwRuN3fhkiJOEA0TX7KoUHl841Wn+9jfzscr08Q0ctZQnPv/ZhOiVUvYm7d4PD6IMd2ih+2LUrbch5i6FJOezv0+hnUCSlxhkPYGBZIPCvuEwp3YW8bCxy7TeJ1jgd7oSH5UypUCk0H8NhCWNh1hnk6Kq1jWjB+0Xqg16u7CUU6ri4XIhUzaLOKjyJIqjojmg4E8MmREwW+sKN5OP0eQzAqeUhaOmLpBqNeKcpliCt9le59IgDF3x7So0/XVPcSSSaO5nD9w7FTXER/k67GKZIqa8D+fJcS6JoepVBdJ0sVBHWrRyPMPW7etEMCyv4EQUP2TO5+OV3zt/KdrsZJiDJOfjAr0dttXRgnXp559USozg4wF42Xie60ijliP7SWybeN8m+AtX/BdP5TBikMpFcKq620XF0eCTrF82KAYC4z3nTGpnSctgE7ToqXd7yosDHo6vB3VcOirWyyzms/h3lymTJNezdNg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Yck6scadqP0+hVz+VGniFctww7j36rPGfwAdU2uYibWtGgKYXro0D1VZ3acC1ubNgJuATn8XoKnza1REf/0ovCZs9A/gSh3C7V2nh/DkFl7Wa0UjQQtrHBfflV43xQR5YSTD04LjFlFz+i4ZavIJD1/2PgtrcNoR9+53wnce8pSELu7qFllZf+T4i0CbE5lmzDovw6E6ZoAHcKH1GmML2hFODoiqjjq8RyBoaSaO2UoinHPF/GzBfH2U4Dw7ZSoF9zbCT5yXZpQX0r2zhno1UQX7m4waW770BsaqLTh8gBfjuVtGwhD2xy4ebE9WivbIzotswKRGTAMNQSJSylkXu/iQg4VDBzqUj/5rdpjz0uZyyo5hRM8jbryqYahYw2ZxfQRG80qF/wl77c6xCqP+KqDL53RX3zcXpx7XZBeogO81+0HRS/EvlJGsdY1qLTr3rMsjh12ti6jG7A/cTKtM+MrWVf8PtSULLktjVR5rZ4YkwgfaXR+JF2xMijHoaoLxk4Cs8yDF6AaG9TDu/YVvUD1ILZWipb7Ch4hZCM8LFuhkxgKm+bJlbrsP2vBgzq3rubQa0Tj4IigCPT1iQ8YVpmt1SV0eH7JdOofTtT2JnTF6GP6anKgpjEzn9IaL2JEwmx9PqTWOeAxfq6PDxoWyISUWOyzWoZA5hKVmlE4jNyAjErSQAftkJBQDkGNCuoCiKhRf9b9QfGTOPiCP9Lpk5g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d796d85d-99f0-45a0-7259-08d99a1b337a X-MS-Exchange-CrossTenant-AuthSource: DB9PR08MB6633.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2021 13:59:47.4484 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2583 Received-SPF: pass client-ip=40.92.64.30; envelope-from=stardiviner@outlook.com; helo=EUR01-DB5-obe.outbound.protection.outlook.com X-Spam_score_int: 23 X-Spam_score: 2.3 X-Spam_bar: ++ X-Spam_report: (2.3 / 5.0 requ) BAYES_40=-0.001, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, MSGID_FROM_MTA_HEADER=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635429728; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=992jwg0XzmIETdukrHtcM+qJXqXKDgAdfxvEn+ewOn8=; b=XOb/02C40EzVQ9+mlRdtwBvcl7JM/Vcth1e29Cu1cVrOihn7YAtYrDCsoh6lSig2SsLPtC MEiofJAleW5L0wnwNxBgKqoVkywFbmlBGEMaPy790xIYqO1YA+t1kOQg41KHcgoFE0Ly2m 87yHWySQTxkqxQXvQ0tLswDd1/qHYbXv34INN0ZLK/TXIT33TNGq2+uEIy+mfGiqdd9EhQ oa5WRM7h1W+Sbm60ApAyIV69Mfm/vby9EAC4NU0QbjHSkbN2qPLqMaBUe0oELLjHryuove eGBf3EPrC4xZlk+9QTPjWLD3xNcSkZWd5eMuRNSe5CuHvGuDPBpdQKbQrqfHcA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1635429728; a=rsa-sha256; cv=pass; b=D5OamnsutwvTzuGEM+XOwpFZn8Ka8eTxq4hNYofSTnmeGI83o+1qTh4E6eJdm3W4I+P2/e 698qKrZgQs9qRPJOm2MdfWViyiQNhCRgoMqdGFydQm7NJj9Nrfdn5qoG8HHdKZ6Ot4adU2 Xd+3l0EwtuB+UEm4v/qQiGI75K4KH9eVrS3IIHHTyLaz0mPhotsf/0JgW5QllYY49jEEJt UwhFYDO5WXkHRRym7MT0sZYwZea1NZ9hB0UZRNdvLBXU/V9S4x5BIXisLp8PKV4Ize/Q2C VGon47VZTCsSEAqbEJO9O7qb3ccYreaFIfh10CM6CmC990Pn9BxoLRuaxST6Xg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=sT+jQTrJ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.16 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=sT+jQTrJ; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 5C36731912 X-Spam-Score: -3.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: D3e5D0e3IkpC --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain Ihor Radchenko writes: > "Christopher M. Miles" 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 --==-=-= Content-Type: text/html

Ihor Radchenko <yantar92@gmail.com> writes:

"Christopher M. Miles" <numbchild@gmail.com> writes:

Here is the profiler report:

CPU:

#+beginexample 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

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)

Memory:

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)

--==-=-=-- --=-=-= Content-Type: text/plain <#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 --=-=-=--