UP | HOME

Support via Liberapay

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:

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
  • 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:
  • 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 *.elc files (compiled Elisp files)
    • eln-cache/
    • [ ] further files/directories

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?
  • 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

Documentation from the orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the GNU Free Documentation License version 1.3 or later. The code examples and css stylesheets are licensed under the GNU General Public License v3 or later.