emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prettify-symbols-mode in org agenda?


From: Ihor Radchenko
Subject: Re: prettify-symbols-mode in org agenda?
Date: Tue, 04 May 2021 12:23:02 +0800

Bastien <bzg@gnu.org> writes:
> Could it slow down agenda generation for some configurations?

Yes, it can. Specifically, fontifying tags can be costly. For
illustration, below if profiler report for a very large agenda buffer
(1468 entries):

19820  95%   - org-agenda
...
4401  21%                   - org-agenda-fix-displayed-tags
3711  17%                    + org-mode
...
1410   6%                  - org-buffer-substring-fontified
1380   6%                   + jit-lock-fontify-now
(full profiler report at the end of the message)

The total slowdown is ~30%, though the second part will only be slow
before the headings are fontified first time by
org-buffer-substring-fontified. Subsequent agenda rebuilds will be
faster.

The first part is harder. It is related to tag fontification. Currently,
agenda fetches tag list as unfontified strings via org-get-tags. So, I
had to re-fontify tags manual is temporary org-mode buffer. You can see
that running org-mode in fresh buffer takes a lot of time. Alternative
approach would be modifying org-get-tags to return fontified strings,
but I am not sure if it is safe to do - unrelated parts of org
might be affected. Or I can write something like org-get-tags-fontified.
What do you think?

Best,
Ihor
20147  96% - command-execute
20147  96%  - funcall-interactively
19820  95%   - org-agenda
19820  95%    - apply
19820  95%     - ad-Advice-org-agenda
19820  95%      - #<compiled -0x1c8480b91ecb5c12>
19820  95%       - apply
19820  95%        - #<compiled -0xb7e1059dab93556>
19761  94%         - call-interactively
19761  94%          - funcall-interactively
19741  94%           - org-todo-list
13331  63%            - org-agenda-get-day-entries
13331  63%             - apply
13331  63%              - #<compiled -0xff9c793bf0466ec>
13331  63%               - org-agenda-get-todos
13331  63%                - apply
13331  63%                 - #<compiled -0x1e7566f8a2160f5f>
8115  38%                  - org-agenda-format-item
4401  21%                   - org-agenda-fix-displayed-tags
3711  17%                    + org-mode
409   1%                    + font-lock-ensure
161   0%                    + org-fold-core--fix-folded-region
40   0%                    + #<compiled -0x1c8bdc957a9aff0b>
3554  17%                   - eval
3554  17%                    - format
3554  17%                     - format
3544  17%                      - org-eval
3463  16%                       + yant/format-time-balance-multiplier
81   0%                       + yant/format-summary-for-agenda
10   0%                      + if
40   0%                     replace-regexp-in-string
10   0%                     org-get-time-of-day
3185  15%                  - org-get-tags
3095  14%                   + org-up-heading-safe
20   0%                     org--get-local-tags
20   0%                   + org-before-first-heading-p
10   0%                   + mapcar
10   0%                   + org-remove-uninherited-tags
1410   6%                  - org-buffer-substring-fontified
1380   6%                   + jit-lock-fontify-now
362   1%                    org-get-priority
39   0%                    org-add-props
20   0%                    org-get-todo-state
10   0%                    org-agenda-skip
10   0%                    replace-regexp-in-string
9   0%                    org-agenda-new-marker
5400  25%            - org-agenda-finalize
2920  14%             + org-get-tags
1380   6%             + run-hooks
610   2%               org-agenda-fontify-priorities
340   1%             + org-agenda-align-tags
30   0%             + org-activate-links
20   0%             + org-agenda-mark-clocking-task
730   3%            + org-agenda-prepare
150   0%            + org-agenda-finalize-entries
80   0%            + org-fold-core--fix-folded-region
59   0%         + org-agenda-get-restriction-and-command



reply via email to

[Prev in Thread] Current Thread [Next in Thread]