When your Org files grow, agenda generation may slow down.
Here are some tips on how to speed up the agenda generation. For those tips that depend on a specific version of Org, we mention this version.
The more agenda files, the more time it takes to check all of them before producing an agenda command. The older your hardrive is, the longer it takes to visit a file. Don't buy a new harddrive now! Just reduce the number of agenda files.
Also, don't forget that you can define the set of agenda files for each agenda custom command like this:
(setq org-agenda-custom-commands '((" " "Aujourd'hui" agenda "List of rendez-vous and tasks for today" ((org-agenda-files '("~/org/rdv.org" "~/org/bzg.org"))))))
When matching against TODO-type tasks, Org will skip the ones marked as DONE or archived. If you have many DONE tasks and archived tasks in your file, better to store them in another file.
When you run an agenda command, Org visits agenda files that are not yet
visited. When finding a file for the first time, Org checks the startup
options and apply them to the buffer: those options are either globally set
org-startup-* variables or on a per-file basis through the
Especially, Org will honor the startup visibility status, as set by
This may slow down the operation of visiting a file very much, and the process of selecting agenda entries consequently.
To prevent agenda commands to honor startup options when visiting an agenda file for the first time, use this:
(setq org-agenda-inhibit-startup t)
The side-effect is that newly visited file will have all their headlines visible, but this speeds up agenda generation a lot when those files have many nested headlines.
Defining inherited tags for a headline in the agenda takes time, because Org needs will grab inherited tags from higher level headlines.
Whether the agenda knows about inherited tags for each task depends on =org-use-tag-inheritance= and =org-agenda-use-tag-inheritance=:
org-use-tag-inheritancecontrols whether tags are inherited for
org-agenda-use-tag-inheritancecontrols whether tags are inherited for
Generally, you want this variable to be nil, because the headlines on
those agenda types don't depend on tags (and a fortiori on inherited
ones.) Still, the default is to use tags in all agenda types, because
org-agenda-show-inherited-tags needs to do the right thing by default.
What to do? If you don't need inherited tags in todo/search/timeline/agenda, just use this setting:
(setq org-agenda-use-tag-inheritance nil)
If you need tags in todo agendas only:
(setq org-agenda-use-tag-inheritance '(search timeline agenda))
You can also set this on a per-command basis:
(setq org-agenda-custom-commands '((" " "Aujourd'hui" agenda "List of rendez-vous and tasks for today" ((org-agenda-files '("~/org/rdv.org" "~/org/bzg.org")) (org-agenda-use-tag-inheritance nil)))))