Org performance tips
This page collects links and tips for improving performance as well as stability of your Org-mode setup. If you do not have a customized Org-mode setup and if you're not working with fairly large Org-mode files, you most probably don't need this page at all.
However, if you do have a highly customized Emacs/Org-mode setup maybe in combination with very large or many Org-mode files, you might find something useful in here.
Please do add more tips (what) and sources (why) if you stumble upon a relevant thing in that context. Extend the current list, if you do have further information.
What Are Large Org File Setups?
- The focus of this page is about issues related to large or many Org files and not large Emacs Elisp configuration files.
- If you're dealing with less than maybe 100,000 lines of Org data (rough estimate), you might not see much performance issues with this approach except you might have splitted those into more than maybe a couple of hundreds Org files.
- Examples of large Org setups:
- Karl Voit: UOMF: My Current Org Mode Files and Heading Structure + My Emacs Configuration In Org-mode
[ ]more examples of people who wrote about their large Org setup
How to Analyze Performance Issues?
The most important part here is to learn how to use the Emacs profiler.
- (FIXXME: are there more tips besides the profiler?)
Which Org-Mode Operations Tend to Take Longer the More Data You Process?
- generating agendas
- There is a separate page for Agenda optimization which is very interesting to read.
- jumping to id: properties
[ ]needed: reason, counter-measures, more specific situations where this is relevant, …
- refiling
[ ]needed: reason, counter-measures, more specific situations where this is relevant, …
General Optimization Tips
- Disable some stuff if you can:
- get rid all packages you don't actually need in your daily Emacs life: each additional package might introduce side-effects that may also affect performance. Furthermore, the more packages you do have active, the more complicated can it get to debug performance issues.
column-number-mode- https://www.gnu.org/software/emacs/manual/html_node/efaq/Displaying-the-current-line-or-column.html
[ ]citation needed for performance issues related to that
org-indent-mode- https://orgmode.org/manual/Org-Indent-Mode.html
[ ]citation needed for performance issues related to that
- garbage collection optimization
- Caution, by manipulating the gc settings, you also make your situation worse. Many things here depend on your personal situation and if you want to invest more RAM for gaining speed and such.
yantar92 is using following settings without further settings:
;; For IGC branch (setq igc-step-interval 0.04) (setq gc-cons-percentage 0.2) (setq gc-cons-threshold (* 200 1000 1000)) (add-hook 'after-init-hook (lambda () (setq gc-cons-threshold (* 20 1000 1000)))) (setq garbage-collection-messages nil) ; nil is default, this is just to remind about the option- There is https://github.com/emacsmirror/gcmh but this might not be an optimal solution for many setups.
- "many smaller Org files" (like Zettelkästen-methods vs. "few (very) large Org files"
- if possible, archive (sub-)headings you don't need in an "active" Org file.
- avoid too many entries in
:LOGBOOK:drawers[ ]citations and details needed: just LOGBOOK drawers? Oritentational numbers instead of "many entries".[ ]wanted: Elisp function that mitigates the issue by moving older(?):LOGBOOK:entries to a different drawer (:LOGBOOK_ARCHIVE:?).
- get rid of outdated/miscompiled/problematic (m)elpa packages → move then away and install them from the Internet in order to replace outdated files.
- remove any cache directories or data within your emacs configuration directory and let Emacs start it from scratch.
- file
.org-id-locations - all
*.elcfiles (compiled Elisp files) eln-cache/[ ]further files/directories
- file
Version-Related Improvements
- https://blog.tecosaur.com/tmio/2022-05-31-folding.html
- "The fabulous new folding engine (
org-fold-core) should noticeably improve Org’s performance with large files." - Note that the underlying issue was actually fixed on the Emacs side.
[ ]Which Org-mode version was that?
- "The fabulous new folding engine (
- 2025-02 with Emacs version 30: opening buffers got significantly faster.
[ ]more about major versions and their impact on Org performance
Off-Standard Approaches for Org Retrieval
- https://github.com/alphapapa/org-ql
org-ql-find: much better query performance
- via databases
- org-db.el
- generates a database representation of your Org file content and provides a fast query interface for it.
- Find stuff in org-mode anywhere
- https://github.com/meedstrom/org-mem
- Turn thousands of Org files into a database in seconds
- Builds quickly, so that there is no need to persist data across sessions.
- Two different APIs to access the same data.
- Emacs Lisp
- SQL
- SQLite
- org-db.el