Re: Bad save performance on `main` branch

2022-08-15 Thread Ihor Radchenko
Ragnar Groot Koerkamp  writes:

> Steps to reproduce are already in [1], but I hope the profiles below should
> give a start at finding the cause of this issue.

I am sorry, but I am unable to reproduce anything using the provided
.org file. The file contains references to non-existing bibliography.

Could you please detail the steps starting from emacs -Q?

> org-export-copy-buffer
>   5039  64%  - # 0x282f7cab5f98f9e>
>   4994  63%   - org-mode
>   4499  57%- run-mode-hooks
>   4485  57% - run-hooks

This is very odd. org-export-copy-buffer explicitly disables all the
mode hooks:

  ;; Set major mode. Ignore `org-mode-hook' as it has been run
  ;; already in BUFFER.
  (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode))

-- 
Ihor Radchenko,
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



Bad save performance on `main` branch

2022-08-15 Thread Ragnar Groot Koerkamp
Hi all,

I ran into an issue [1] [2] with ox-hugo where exporting an org file on
auto-save takes very long (3+ seconds) compared to ~0.2s normally. This is
using commit 00adad935 on the main branch from a few days back (using
Doom). See below for a cpu profile.

After switching back to the bugfix branch (6e991f4bb), the auto-save is
fast again. Again see the cpu profile below.

Steps to reproduce are already in [1], but I hope the profiles below should
give a start at finding the cause of this issue.

Thanks!

1: https://github.com/kaushalmodi/ox-hugo/issues/665
2: https://github.com/kaushalmodi/ox-hugo/discussions/551

Slow ~3s export on branch main (00adad935):

  7354  93% - command-execute
  7354  93%  - funcall-interactively
  7354  93%   - save-buffer
  7354  93%- basic-save-buffer
  7349  93% - run-hooks
  7323  93%  - org-hugo-export-wim-to-md-after-save
  7323  93%   - org-hugo-export-wim-to-md
  7321  93%- org-hugo--export-file-to-md
  7318  93% - org-hugo-export-to-md
  7314  92%  - org-export-to-file
  7314  92%   - apply
  7305  92%- +org--fix-async-export-a
  7305  92% - let
  7305  92%  - apply
  7305  92%   - #
  7305  92%- apply
  7305  92% - +org--dont-trigger-save-hooks-a
  7305  92%  - let
  7305  92%   - apply
  7305  92%- #
  7301  92% - org-export-as
  7301  92%  - apply
  7301  92%   - +org--fix-async-export-a
  7301  92%- let
  7298  92% - apply
  7298  92%  - #
  6991  88%   - org-export-data
  6991  88%- mapconcat
  6991  88% - #
  6991  88%  - org-export-data
  6987  88%   - mapconcat
  6987  88%- #
  6983  88% - org-export-data
  6977  88%  - mapconcat
  6977  88%   - #
  6977  88%- org-export-data
  6971  88% - mapconcat
  6971  88%  - #
  6971  88%   - org-export-data
  6775  86%- mapconcat
  6775  86% - #
  6775  86%  - org-export-data
  5356  68%   -
org-blackfriday-latex-fragment
  5354  68%-
org-html-format-latex
  5321  67% -
org-export-copy-buffer
  5039  64%  - #
  4994  63%   - org-mode
  4499  57%- run-mode-hooks
  4485  57% - run-hooks
  1777  22%  +
global-flycheck-mode-enable-in-buffers
   939  11%  +
global-emojify-mode-enable-in-buffers
   556   7%  +
evil-mode-enable-in-buffers
   449   5%  +
yas-global-mode-enable-in-buffers
   322   4%  +
ws-butler-global-mode-enable-in-buffers
   254   3%  +
global-company-mode-enable-in-buffers
   122   1%  +
global-font-lock-mode-enable-in-buffers
38   0%  +
+format-enable-on-save-maybe-h
 7   0%  +
global-undo-fu-session-mode-enable-in-buffers
 6   0%  +
global-anzu-mode-enable-in-buffers
 6   0%  +
global-evil-surround-mode-enable-in-buffers
 3   0%  +
evil-snipe-override-mode-enable-in-buffers
14   0% + apply
   157   1%+ outline-mode
   123   1%+
org-fold-initialize
96   1%+
org-element-cache-reset
49   0%+ add-hook
36   0%+
org-install-agenda-files-menu
13   0%+
org-set-regexps-and-options
 7   0%+