1 #+TITLE: Agenda speedup and optimization
2 #+AUTHOR: Bastien Guerry
3 #+STARTUP: align fold nodlcheck hidestars oddeven
4 #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
7 #+OPTIONS: H:3 num:nil toc:t \n:nil ::t |:t ^:t -:t f:t *:t tex:t d:(HIDE) tags:not-in-toc
8 #+LINK: doc https://orgmode.org/worg/doc.html#%s
10 # This file is released by its authors and contributors under the GNU
11 # Free Documentation license v1.3 or later, code examples are released
12 # under the GNU General Public License v3 or later.
14 When your Org files grow, agenda generation may slow down.
16 Here are some tips on how to speed up the agenda generation. For those
17 tips that depend on a specific version of Org, we mention this version.
19 #+INDEX: Agenda speedup
21 * Reduce the number of Org agenda files
23 The more agenda files, the more time it takes to check all of them before
24 producing an agenda command. The older your hardrive is, the longer it
25 takes to visit a file. Don't buy a new harddrive now! Just reduce the
26 number of agenda files.
28 Also, don't forget that you can define the set of agenda files for each
29 agenda custom command like this:
31 #+BEGIN_SRC emacs-lisp
32 (setq org-agenda-custom-commands
33 '((" " "Aujourd'hui" agenda "List of rendez-vous and tasks for today"
34 ((org-agenda-files '("~/org/rdv.org" "~/org/bzg.org"))))))
37 * Reduce the number of DONE and archived headlines
39 When matching against TODO-type tasks, Org will skip the ones marked as
40 DONE or archived. If you have many DONE tasks and archived tasks in your
41 file, better to store them in another file.
43 * Inhibit the dimming of blocked tasks
45 #+INDEX: Dim blocked tasks
46 #+INDEX: org-agenda-dim-blocked-tasks
48 By default [[doc::org-agenda-dim-blocked-tasks][org-agenda-dim-blocked-tasks]] is set to t, which will dim blocked
49 tasks. For the agenda to get the relevant information, it needs to check
50 against the headline up, and this takes time. If you don't need this
51 feature globally or for a specific agenda, turning it off will speed up
54 * Inhibit agenda files startup options (Org > 8.0)
56 #+INDEX: org-startup-folded
58 When you run an agenda command, Org visits agenda files that are not yet
59 visited. When finding a file for the first time, Org checks the startup
60 options and apply them to the buffer: those options are either globally set
61 through the =org-startup-*= variables or on a per-file basis through the
64 Especially, Org will honor the startup visibility status, as set by
65 [[doc::org-startup-folded][org-startup-folded]] or =#+STARTUP: folded=.
67 This may slow down the operation of visiting a file very much, and the
68 process of selecting agenda entries consequently.
70 To prevent agenda commands to honor startup options when visiting an agenda
71 file for the first time, use this:
73 #+BEGIN_SRC emacs-lisp
74 (setq org-agenda-inhibit-startup t)
77 The side-effect is that newly visited file will have all their headlines
78 visible, but this speeds up agenda generation /a lot/ when those files have
79 many nested headlines.
81 * Disable tag inheritance in agendas (Org > 8.0)
83 #+INDEX: Tag inheritance
84 #+INDEX: org-use-tag-inheritance
85 #+INDEX: org-agenda-use-tag-inheritance
86 #+INDEX: org-agenda-show-inherited-tags
88 Defining inherited tags for a headline in the agenda takes time, because
89 Org needs will grab inherited tags from higher level headlines.
91 Whether the agenda knows about inherited tags for each task depends on
92 [[doc::org-use-tag-inheritance][org-use-tag-inheritance]] and [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]]:
94 - [[doc::org-use-tag-inheritance][org-use-tag-inheritance]] controls whether tags are inherited for tags-type
95 agenda commands: =tags=, =tags-todo= and =tags-tree=. This variable also
96 controls whether tags are inherited when running the command =M-x
97 org-sparse-tree RET= in an Org buffer (hence the name of this variable,
98 without the =org-agenda-= prefix.)
100 - [[doc::org-agenda-use-tag-inheritance][org-agenda-use-tag-inheritance]] controls whether tags are inherited for
101 other agenda types too: =todo=, =search=, =timeline=, =agenda=.
103 Generally, you want this variable to be nil, because the headlines on
104 those agenda types don't depend on tags (and /a fortiori/ on inherited
105 ones.) Still, the default is to use tags in all agenda types, because
106 [[doc::org-agenda-show-inherited-tags][org-agenda-show-inherited-tags]] needs to do the right thing by default.
108 What to do? If you don't need inherited tags in
109 todo/search/timeline/agenda, just use this setting:
111 #+BEGIN_SRC emacs-lisp
112 (setq org-agenda-use-tag-inheritance nil)
115 If you need tags in todo agendas only:
117 #+BEGIN_SRC emacs-lisp
118 (setq org-agenda-use-tag-inheritance '(search timeline agenda))
121 You can also set this on a per-command basis:
123 #+BEGIN_SRC emacs-lisp
124 (setq org-agenda-custom-commands
125 '((" " "Aujourd'hui" agenda "List of rendez-vous and tasks for today"
126 ((org-agenda-files '("~/org/rdv.org" "~/org/bzg.org"))
127 (org-agenda-use-tag-inheritance nil)))))
130 * Disable parsing for some drawer properties
132 Text properties are used to prepare buffers for effort estimates,
133 appointments, and subtree-local categories in the agenda. If you
134 don't use some of these agenda features, you can turn them off.
135 Since using such drawer properties require a special scan before each
136 new agenda command, this can lead to a speedup. For example
138 #+BEGIN_SRC emacs-lisp
139 (setq org-agenda-ignore-drawer-properties '(effort appt category))