Hello, Nicolas Goaziou <[email protected]> writes: > Samuel Loury <[email protected]> writes: > >> I have made a custom agenda command¹ to implement a "kind of" GTD >> workflow. >> >> On a quite old computer with no SSD disk, the commands takes about 20 >> seconds. My org files sum up to 27K lines and 2629 headings (with the >> archives, there are 5630 headings in 66K lines). >> >> I attached the result of elp-instrument-package "org-" when running this >> command without the archives. I don't know if that helps... > > So Org is slow only when calling the agenda?
I would not reach that conclusion so fast. Since I spent most of my time
using the agenda, it is the place where I am most likely to experience
slowness, but that does not mean that org is slow only in that
situation.
On the other hand, I often use the following snippet of code to make
sure the org element cache is up to date and it is very fast (~1s).
--8<---------------cut here---------------start------------->8---
(mapc
(lambda (file)
(save-window-excursion
(save-excursion
(find-file file)
(org-element-cache-reset)
)
)
)
(org-agenda-files)
)
--8<---------------cut here---------------end--------------->8---
> Could you also send a profiler report? Thank you.
Reproducing a slow behavior is not easy. Today, the agenda is produced
in about 10s with almost the same contents. I included the profiler
report anyway, hoping that you will find something useful in it.
- command-execute 3301 91%
- call-interactively 3301 91%
- eval-last-sexp 2868 79%
- eval-last-sexp-1 2868 79%
- eval 2868 79%
- org-agenda 2868 79%
- apply 2868 79%
- ad-Advice-org-agenda 2868 79%
- #<compiled 0x25a8d89> 1922 53%
- byte-code 1922 53%
- org-agenda-run-series 1922 53%
- org-let2 1221 33%
- eval 1221 33%
- let 1221 33%
- let 1221 33%
- org-todo-list 595 16%
- byte-code 583 16%
- byte-code 463 12%
- org-agenda-get-day-entries 463 12%
- org-agenda-get-todos 459 12%
- byte-code 431 11%
org-get-priority 136 3%
- org-agenda-skip 96 2%
- org-agenda-skip-eval 96 2%
- eval 96 2%
- konix/org-agenda-skip-if-tags 96 2%
- let 96 2%
- setq 92 2%
- org-get-tags-at 80 2%
- byte-code 72 1%
- byte-code 72 1%
- org-up-heading-safe 56 1%
org-outline-level 8 0%
- org-remove-uninherited-tags 4
0%
org-delete-all 4 0%
- error 4 0%
apply 4 0%
org-remove-uninherited-tags 4
0%
- progn 8 0%
outline-next-heading 8 0%
- while 4 0%
if 4 0%
- org-agenda-format-item 67 1%
- replace-regexp-in-string 16 0%
apply 4 0%
- org-agenda-fix-displayed-tags 15 0%
- mapconcat 4 0%
#<compiled 0x25719dd> 4 0%
mapcar 3 0%
eval 4 0%
- org-get-time-of-day 4 0%
byte-code 4 0%
- org-get-tags-at 24 0%
- byte-code 16 0%
- byte-code 16 0%
- org-back-to-heading 8 0%
- outline-back-to-heading 8 0%
outline-on-heading-p 4 0%
- org-up-heading-safe 8 0%
org-outline-level 8 0%
org-remove-uninherited-tags 4 0%
- replace-regexp-in-string 16 0%
- funcall 4 0%
#<compiled 0x20afc41> 4 0%
apply 4 0%
org-get-todo-state 8 0%
org-add-props 8 0%
outline-next-heading 8 0%
- org-get-category 8 0%
byte-code 4 0%
org-outline-level 4 0%
- org-agenda-finalize-entries 108 2%
- mapcar 60 1%
- org-agenda-highlight-todo 12 0%
org-add-props 4 0%
- sort 28 0%
org-entries-lessp 12 0%
- call-interactively 514 14%
- org-agenda-list 514 14%
- byte-code 514 14%
- org-get-entries-from-diary 276 7%
- diary-list-entries 276 7%
- diary-list-sexp-entries 160 4%
- diary-sexp-entry 160 4%
- byte-code 160 4%
- eval 160 4%
- org-diary 160 4%
- org-agenda-prepare-buffers 156 4%
- byte-code 156 4%
- org-refresh-stats-properties 32
0%
org-end-of-subtree 4 0%
- org-refresh-effort-properties 24
0%
- org-refresh-properties 24 0%
- org-refresh-property 8 0%
- mapc 8 0%
- #<compiled 0x25cf55b> 8 0%
outline-next-heading 4 0%
- org-duration-string-to-minutes
4 0%
regexp-opt 4 0%
org-refresh-category-properties 20
0%
- org-set-regexps-and-options 16 0%
org--setup-collect-keywords 16
0%
org-refresh-properties 16 0%
- org-end-of-subtree 16 0%
- org-back-to-heading 8 0%
- outline-back-to-heading 8 0%
outline-on-heading-p 4 0%
org-outline-level 4 0%
- org-agenda-files 4 0%
- mapcar 4 0%
#<compiled 0x25fc1ff> 4 0%
- run-hooks 116 3%
- diary-include-other-diary-files 116 3%
- diary-include-files 116 3%
- diary-list-entries 116 3%
diary-pull-attrs 52 1%
- diary-list-sexp-entries 48 1%
diary-pull-attrs 44 1%
diary-list-entries-2 12 0%
- run-hooks 4 0%
- diary-include-other-diary-files 4
0%
diary-include-files 4 0%
- byte-code 226 6%
- apply 226 6%
- org-agenda-get-day-entries 226 6%
- org-agenda-get-deadlines 127 3%
- byte-code 119 3%
- org-agenda-skip 91 2%
- org-agenda-skip-eval 91 2%
- eval 91 2%
- or 91 2%
- konix/org-agenda-skip-if-tags 91
2%
- let 91 2%
- setq 87 2%
- org-get-tags-at 83 2%
- byte-code 83 2%
- byte-code 83 2%
org-up-heading-safe 71 1%
org-remove-uninherited-tags
4 0%
match-string-no-properties
4 0%
- progn 4 0%
outline-next-heading 4 0%
- org-back-to-heading 4 0%
- outline-back-to-heading 4 0%
outline-on-heading-p 4 0%
org-get-todo-state 8 0%
- org-time-string-to-absolute 8 0%
- org-closest-date 8 0%
- byte-code 4 0%
org-parse-time-string 4 0%
org-get-priority 4 0%
- org-agenda-format-item 4 0%
org-add-props 4 0%
abbreviate-file-name 4 0%
- org-agenda-get-timestamps 36 0%
- byte-code 24 0%
- org-agenda-skip 24 0%
- org-agenda-skip-eval 24 0%
- eval 24 0%
- or 24 0%
- konix/org-agenda-skip-if-tags 24
0%
- let 24 0%
- setq 24 0%
- org-get-tags-at 24 0%
- byte-code 24 0%
- byte-code 24 0%
org-up-heading-safe 24 0%
- org-is-habit-p 4 0%
- org-entry-get 4 0%
- org-get-property-block 4 0%
org-back-to-heading 4 0%
- org-agenda-get-scheduled 23 0%
- byte-code 23 0%
- org-agenda-skip 16 0%
- org-agenda-skip-eval 8 0%
- eval 8 0%
- or 8 0%
- konix/org-agenda-skip-if-tags 8
0%
- let 8 0%
- setq 8 0%
- org-get-tags-at 4 0%
- byte-code 4 0%
- byte-code 4 0%
org-up-heading-safe 4 0%
progn 4 0%
- org-end-of-subtree 8 0%
- org-back-to-heading 8 0%
- outline-back-to-heading 8 0%
outline-on-heading-p 4 0%
- org-agenda-format-item 4 0%
mapcar 4 0%
org-get-priority 3 0%
- org-agenda-get-blocks 16 0%
- byte-code 8 0%
- org-agenda-skip 8 0%
- org-agenda-skip-eval 4 0%
- eval 4 0%
- or 4 0%
- konix/org-agenda-skip-if-tags 4
0%
- let 4 0%
- org-back-to-heading 4 0%
outline-back-to-heading 4 0%
abbreviate-file-name 4 0%
- org-agenda-get-sexps 16 0%
- byte-code 8 0%
- org-diary-sexp-entry 8 0%
- byte-code 8 0%
- eval 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
- diary-remind 8 0%
diary-remind 8 0%
- org-get-agenda-file-buffer 4 0%
org-find-base-buffer-visiting 4 0%
- org-agenda-finalize-entries 8 0%
- mapcar 4 0%
- org-agenda-highlight-todo 4 0%
org-add-props 4 0%
- org-tags-view 112 3%
- byte-code 112 3%
- byte-code 108 2%
- org-scan-tags 96 2%
- byte-code 32 0%
org-outline-level 8 0%
apply 4 0%
- mapcar 4 0%
#<compiled 0x25dfe99> 4 0%
org-remove-uninherited-tags 4 0%
- eval 4 0%
- and 4 0%
- and 4 0%
- progn 4 0%
or 4 0%
- org-agenda-files 4 0%
- mapcar 4 0%
#<compiled 0x25fc1ff> 4 0%
- org-let 689 19%
- eval 689 19%
- let 689 19%
- org-agenda-prepare 466 12%
- org-agenda-mode 310 8%
- apply 307 8%
- run-mode-hooks 307 8%
- apply 307 8%
- run-hooks 307 8%
- konix/org-agenda-mode-hook 307 8%
- konix/org-agenda-appt-reload 307 8%
- org-agenda-to-appt 175 4%
- org-agenda-prepare-buffers 155 4%
- byte-code 155 4%
org-refresh-stats-properties 43 1%
- org-set-regexps-and-options 24 0%
org--setup-collect-keywords 12 0%
- org-make-options-regexp 4 0%
- regexp-opt 4 0%
regexp-opt-group 4 0%
- org-refresh-effort-properties 20 0%
- org-refresh-properties 20 0%
- org-refresh-property 13 0%
- mapc 9 0%
- #<compiled 0x25cf55b> 9 0%
- org-duration-string-to-minutes
5 0%
- regexp-opt 5 0%
delete-dups 5 0%
org-back-to-heading 4 0%
org-refresh-properties 16 0%
org-refresh-category-properties 16
0%
- org-end-of-subtree 4 0%
org-back-to-heading 4 0%
- apply 20 0%
- org-agenda-get-day-entries 20 0%
- org-agenda-get-timestamps 12 0%
org-is-habit-p 4 0%
org-agenda-get-scheduled 4 0%
- appt-activate 128 3%
- appt-check 128 3%
- byte-code 128 3%
- diary 128 3%
- diary-list-entries 128 3%
- run-hooks 120 3%
- diary-include-other-diary-files
120 3%
- diary-include-files 120 3%
- diary-list-entries 116 3%
diary-pull-attrs 52 1%
- diary-list-sexp-entries 48 1%
diary-pull-attrs 44 1%
diary-list-entries-2 8 0%
- run-hooks 4 0%
- diary-include-other-diary-files
4 0%
diary-include-files 4 0%
- find-buffer-visiting 8 0%
- file-truename 8 0%
- file-truename 4 0%
- file-truename 4 0%
- file-truename 4 0%
- tramp-completion-file-name-handler
4 0%
- let 4 0%
- if 4 0%
- tramp-completion-run-real-handler
4 0%
- let* 4 0%
- apply 4 0%
- file-truename 4 0%
- file-symlink-p 4 0%
- tramp-completion-file-name-handler
4 0%
- let 4 0%
- if 4 0%
tramp-completion-run-real-handler
4 0%
- org-agenda-files 3 0%
- mapcar 3 0%
#<compiled 0x25fc1ff> 3 0%
- org-agenda-prepare-buffers 152 4%
- byte-code 152 4%
org-refresh-stats-properties 40 1%
- org-refresh-effort-properties 24 0%
- org-refresh-properties 24 0%
- org-refresh-property 8 0%
- mapc 8 0%
- #<compiled 0x25cf55b> 4 0%
- org-duration-string-to-minutes 4 0%
org-hh:mm-string-to-minutes 4 0%
org-refresh-category-properties 20 0%
- org-set-regexps-and-options 20 0%
org--setup-collect-keywords 20 0%
org-refresh-properties 12 0%
org-end-of-subtree 12 0%
- org-agenda-files 4 0%
- mapcar 4 0%
#<compiled 0x25fc1ff> 4 0%
- org-agenda-finalize 191 5%
- org-get-tags-at 72 1%
- byte-code 72 1%
- byte-code 72 1%
- org-up-heading-safe 28 0%
org-outline-level 12 0%
- org-back-to-heading 12 0%
- outline-back-to-heading 12 0%
outline-on-heading-p 8 0%
org-split-string 4 0%
match-string-no-properties 4 0%
org-agenda-align-tags 28 0%
- org-activate-plain-links 24 0%
org-in-src-block-p 4 0%
- konix/org-agenda-filter-context 894 24%
- cond 894 24%
- konix/org-agenda-filter-context_1 894 24%
- let 894 24%
- save-excursion 894 24%
- while 894 24%
- if 894 24%
- progn 894 24%
- if 843 23%
- and 787 21%
- or 787 21%
- not 787 21%
- konix/org-agenda-appt-p 787 21%
- or 787 21%
- let 787 21%
- unwind-protect 783 21%
- progn 755 20%
- save-excursion 723 19%
- org-agenda-goto 596 16%
push-mark 240 6%
- switch-to-buffer-other-window 80
2%
- pop-to-buffer 80 2%
- display-buffer 72 1%
- display-buffer--maybe-pop-up-frame-or-window
36 0%
- display-buffer-pop-up-window
36 0%
- window--try-to-split-window
8 0%
- funcall 8 0%
split-window-sensibly 8
0%
get-lru-window 4 0%
- display-buffer-in-previous-window
24 0%
window--display-buffer 24 0%
- display-buffer-reuse-window 8
0%
get-buffer-window-list 4 0%
- display-buffer--special-action
4 0%
special-display-p 4 0%
- org-show-context 77 2%
- org-flag-heading 32 0%
outline-end-of-heading 16 0%
- org-back-to-heading 8 0%
- outline-back-to-heading 8 0%
outline-on-heading-p 8 0%
- outline-flag-region 4 0%
remove-overlays 4 0%
- byte-code 25 0%
- org-up-heading-all 25 0%
- outline-up-heading 21 0%
- outline-back-to-heading 8 0%
outline-on-heading-p 8 0%
org-outline-level 5 0%
- error 4 0%
apply 4 0%
- org-at-heading-p 8 0%
outline-on-heading-p 4 0%
- org-flag-heading 32 0%
- org-back-to-heading 16 0%
- outline-back-to-heading 16 0%
outline-on-heading-p 12 0%
outline-end-of-heading 12 0%
outline-next-heading 16 0%
- org-back-to-heading 16 0%
- outline-back-to-heading 12 0%
outline-on-heading-p 8 0%
- konix/org-appt-p 75 2%
- or 75 2%
- let 51 1%
- konix/org-get-active-timestamp
43 1%
- let 43 1%
- if 43 1%
- save-excursion 43 1%
- re-search-forward 31 0%
- org-entry-end-position 24
0%
outline-next-heading 20
0%
- org-back-to-heading 8 0%
outline-back-to-heading 8
0%
- and 8 0%
- konix/org-ts-is-today-or-past-p
8 0%
- let 8 0%
- decode-time 8 0%
org-current-time 4 0%
- not 24 0%
- org-entry-is-todo-p 24 0%
- org-get-todo-state 20 0%
- org-back-to-heading 4 0%
outline-back-to-heading 4
0%
set-window-configuration 12 0%
org-agenda-filter-hide-line 56 1%
- konix/org-agenda-set-text-properties 52 1%
- save-excursion 52 1%
- mapc 52 1%
- #<lambda 0x32772d11> 52 1%
- let 52 1%
- while 52 1%
- if 4 0%
- progn 4 0%
let 4 0%
- counsel-M-x 413 11%
- let* 413 11%
- ivy-read 392 10%
- let* 392 10%
- progn 392 10%
- let 392 10%
- prog1 299 8%
- unwind-protect 278 7%
- let 278 7%
- unwind-protect 278 7%
- progn 278 7%
- let* 278 7%
- read-from-minibuffer 269 7%
- ivy--exhibit 187 5%
- if 187 5%
- progn 187 5%
- if 187 5%
- ivy--insert-minibuffer 187 5%
- save-current-buffer 183 5%
- ivy--format 183 5%
- ivy--filter 167 4%
- let 167 4%
- if 162 4%
- let* 161 4%
- cond 81 2%
- ivy--re-filter 81 2%
- let 81 2%
- let 81 2%
- while 81 2%
- let 81 2%
- setq 81 2%
- condition-case 81 2%
- progn 81 2%
- funcall 81 2%
- cl-remove-if-not 81 2%
- apply 81 2%
- cl-remove 73 2%
#<lambda 0x17e060e> 37
1%
- apply 24 0%
- cl-delete 16 0%
#<lambda 0x2efda8e7>
8 0%
- setq 40 1%
- ivy--sort 40 1%
- let 40 1%
- cond 40 1%
and 40 1%
- ivy--recompute-index 40 1%
- let* 40 1%
- if 40 1%
- setq 40 1%
- or 40 1%
- and 40 1%
- not 40 1%
and 40 1%
- funcall 5 0%
- ivy--regex-ignore-order 5 0%
- let 5 0%
- cond 5 0%
- if 5 0%
- ivy--regex-ignore-order--part 5
0%
- let* 5 0%
- cond 5 0%
- mapcar 5 0%
- #<lambda 0x30cfeefb> 3 0%
- cons 3 0%
- ivy--format-minibuffer-line
3 0%
- let 3 0%
- cond 3 0%
- if 3 0%
- progn 3 0%
- let 3 0%
- let 3 0%
- while 3 0%
- let 3 0%
- if 3 0%
- progn 3 0%
- ivy-add-face-text-property
3 0%
if 3 0%
- if 16 0%
- let* 16 0%
- let* 16 0%
- concat 16 0%
- funcall 16 0%
- #<lambda 0x33b4beab> 16 0%
- funcall 16 0%
- let 16 0%
- save-current-buffer 16 0%
- unwind-protect 16 0%
- progn 16 0%
- mapcar 16 0%
- counsel--M-x-transformer 16
0%
let* 16 0%
- let 4 0%
- ivy--cleanup 4 0%
save-excursion 4 0%
- timer-event-handler 5 0%
- byte-code 5 0%
apply 5 0%
- #<lambda 0xd6c0a8c> 4 0%
- funcall 4 0%
- ivy--minibuffer-setup 4 0%
- ivy--exhibit 4 0%
- if 4 0%
- progn 4 0%
- if 4 0%
- ivy--insert-minibuffer 4 0%
- let 4 0%
if 4 0%
- redisplay_internal (C function) 4 0%
- #<compiled 0x21b7605> 4 0%
- apply 4 0%
- redisplay--update-region-highlights 4 0%
- funcall 4 0%
- #<compiled 0x2d3043d> 4 0%
redisplay--update-region-highlight 4
0%
- cua--pre-command-handler 3 0%
- cua--pre-command-handler-1 3 0%
- apply 3 0%
- ad-Advice-cua--pre-command-handler-1 3 0%
- let 3 0%
- unless 3 0%
- if 3 0%
- setq 3 0%
- with-no-warnings 3 0%
funcall 3 0%
- minibuffer-inactive-mode 3 0%
- run-mode-hooks 3 0%
- run-hooks 3 0%
- global-font-lock-mode-enable-in-buffers 3
0%
- turn-on-font-lock-if-desired 3 0%
turn-on-font-lock 3 0%
- ivy-call 21 0%
- let 21 0%
- if 21 0%
- progn 21 0%
- let* 21 0%
- prog1 21 0%
- funcall 21 0%
- #<lambda 0x23635208> 21 0%
- let 21 0%
- command-execute 21 0%
- call-interactively 21 0%
- profiler-report 12 0%
- profiler-report-cpu 12 0%
profiler-cpu-profile 12 0%
- byte-code 9 0%
- completing-read 9 0%
- ivy-completing-read 9 0%
- if 9 0%
- ivy-read 9 0%
- let* 9 0%
- progn 9 0%
- let 9 0%
- prog1 9 0%
- unwind-protect 9 0%
- let 9 0%
- unwind-protect 9 0%
- progn 9 0%
- let* 9 0%
- read-from-minibuffer 9 0%
- timer-event-handler 5 0%
- byte-code 5 0%
apply 5 0%
- ivy--reset-state 93 2%
- let 93 2%
- let 75 2%
- if 43 1%
- progn 43 1%
- if 23 0%
- if 23 0%
- if 23 0%
- setq 23 0%
- cl-sort 23 0%
sort 4 0%
- setq 20 0%
- ivy--filter 20 0%
- let 20 0%
- if 20 0%
- let* 20 0%
- setq 12 0%
- ivy--sort 12 0%
- let 12 0%
- cond 12 0%
and 12 0%
- ivy--recompute-index 8 0%
- let* 8 0%
- if 8 0%
- setq 4 0%
- or 4 0%
cl-position 4 0%
- progn 4 0%
- setq 4 0%
- or 4 0%
- ivy--preselect-index 4 0%
- cond 4 0%
cl-position 4 0%
- cond 32 0%
setq 32 0%
- setq 18 0%
- or 18 0%
- thing-at-point 18 0%
- thing-at-point-url-at-point 18 0%
- thing-at-point-bounds-of-url-at-point 18 0%
- thing-at-point--bounds-of-well-formed-url 18
0%
- regexp-opt 18 0%
- regexp-opt-group 18 0%
- regexp-opt-group 18 0%
- regexp-opt-group 18 0%
- regexp-opt-group 18 0%
- regexp-opt-group 18 0%
- regexp-opt-group 12 0%
- mapcar 8 0%
#<compiled 0x20ddb33> 8 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
- regexp-opt-group 4 0%
mapcar 4 0%
mapcar 6 0%
if 21 0%
- ivy-completing-read 20 0%
- if 20 0%
- ivy-read 20 0%
- let* 20 0%
- progn 20 0%
- let 20 0%
- prog1 20 0%
- unwind-protect 20 0%
- let 20 0%
- unwind-protect 20 0%
- progn 20 0%
- let* 20 0%
read-from-minibuffer 20 0%
- ... 303 8%
Automatic GC 303 8%
- yas--post-command-handler 8 0%
- cond 8 0%
- yas--check-commit-snippet 8 0%
- let* 8 0%
- yas--snippets-at-point 8 0%
- sort 8 0%
- remove 8 0%
- remove-duplicates 8 0%
cl--delete-duplicates 4 0%
- mic-paren-command-hook 6 0%
- or 6 0%
- mic-paren-command-idle-hook 6 0%
- condition-case 6 0%
- mic-paren-highlight 6 0%
- let 6 0%
- let* 6 0%
- unwind-protect 6 0%
- progn 6 0%
- if 6 0%
- progn 6 0%
- if 6 0%
- set-mismatch/face/visible 6 0%
- setq 6 0%
if 6 0%
-- Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A
signature.asc
Description: PGP signature
