org-mode/lisp
Ihor Radchenko ba273278a5 Use cache in org-up-heading-safe
* lisp/org.el (org-up-heading-safe): Use buffer-local cache to store
positions of parent headings.  The cache is invalidated when buffer
text is changed, according to `buffer-chars-modified-tick'.
(org--up-heading-cache):  Buffer-local hash-table storing the cache.
(org--up-heading-cache-tick):  The buffer modification state for
currently active `org--up-heading-cache'.

The optimisation is critical when running agenda or org-entry-get
queries using property/tag inheritance.  In such scenarios
`org-up-heading-safe' can be called thousands of times.  For example,
building todo agenda on large number of headings lead to the following
benchmark results:

Benchmark:

1. (elp-instrument-function #'org-up-heading-safe)
2. Run agenda
3. (elp-results) ;; function, # calls, total time, avg time

Without cache:
org-up-heading-safe  27555       8.4234025759  0.0003056941

With cache, first run:
org-up-heading-safe  23227       0.5300747539  2.282...e-05

With cache, second run on unchanged buffer:
org-up-heading-safe  23227       0.1447754880  6.233...e-06

The final speedup is 1-2 orders of magnitude (~15-56 times).
2021-05-15 13:58:05 +02:00
..
Makefile Move link-related core functions out of "org.el" 2019-03-10 18:00:27 +01:00
ob-C.el ob-C: Adjust pcase pattern for Emacs 24 compatibility 2021-05-01 15:43:01 -04:00
ob-J.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-R.el lisp/ob-R.el: Fix session output with substrings matching prompts 2021-05-03 00:15:09 +02:00
ob-abc.el Merge branch 'maint' 2021-01-01 15:02:10 -05:00
ob-asymptote.el Add Luc Pellissier as maintainer for two ob-* files 2021-05-12 06:33:13 +02:00
ob-awk.el lisp/ob-awk.el: Add Tyler Smith as the maintainer 2021-05-08 09:40:23 +02:00
ob-calc.el lisp/ob-calc.el: Add Tom Gillespie as the maintainer 2021-05-07 09:31:36 +02:00
ob-clojure.el Backport commit 8b07994e2 from Emacs 2021-03-25 00:56:53 -04:00
ob-comint.el Backport commit f8dbefbaa from Emacs 2021-02-14 17:38:07 -05:00
ob-coq.el Add Luc Pellissier as maintainer for two ob-* files 2021-05-12 06:33:13 +02:00
ob-core.el compat: Add `org-string-distance' 2021-05-05 17:54:36 +02:00
ob-css.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-ditaa.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-dot.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-ebnf.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-emacs-lisp.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-eshell.el Merge branch 'maint' 2021-01-01 15:02:10 -05:00
ob-eval.el ob-eval.el: Refactoring `org-babel-eval' to improve readability 2021-04-30 08:56:33 +02:00
ob-exp.el ob-exp: Do not comma-escape inline source code 2021-04-13 09:55:29 +02:00
ob-forth.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-fortran.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-gnuplot.el lisp/ob-gnuplot.el: Use `org-babel-local-file-name' 2021-05-01 16:32:56 +02:00
ob-groovy.el lisp/ob-groovy.el: Fix link 2021-05-03 14:59:44 +02:00
ob-haskell.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-hledger.el Backport commit 0a4dc7083 from Emacs 2021-04-19 20:07:28 -04:00
ob-io.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-java.el ob-java: Fix previous commit 2021-02-14 15:42:18 -05:00
ob-js.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-latex.el Shorten remaining over-wide docstrings 2021-02-23 23:35:57 -05:00
ob-ledger.el lisp/ob-ledger.el: Add Eric S Fraga as the maintainer 2021-05-04 13:06:21 +02:00
ob-lilypond.el Allow user to set ob-lilypond header arguments 2021-04-26 10:26:07 +02:00
ob-lisp.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-lob.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-lua.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-makefile.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-matlab.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-maxima.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-mscgen.el Merge branch 'km/from-emacs-master' 2021-04-19 22:55:03 -04:00
ob-ocaml.el ob-ocaml: Update stale tuareg-mode link in commentary 2021-03-29 00:33:49 -04:00
ob-octave.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-org.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-perl.el Merge branch 'maint' 2021-01-01 15:02:10 -05:00
ob-picolisp.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-plantuml.el Fix 7da20ff21 2021-05-01 12:50:10 +02:00
ob-processing.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-python.el Merge branch 'maint' 2021-01-01 15:02:10 -05:00
ob-ref.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-ruby.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-sass.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ob-scheme.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-screen.el Merge branch 'maint' 2021-01-01 15:02:10 -05:00
ob-sed.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-shell.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-shen.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-sql.el Merge branch 'maint' 2021-05-01 12:27:18 +02:00
ob-sqlite.el Merge branch 'maint' 2021-05-04 22:44:34 +02:00
ob-stan.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-table.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob-tangle.el ob-tangle.el: Fix single block tangle 2021-05-06 13:37:18 +02:00
ob-vala.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ob.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ol-bbdb.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
ol-bibtex.el Prefer HTTPS to HTTP in most links 2021-03-21 15:21:22 -04:00
ol-docview.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ol-doi.el Add DOI links export 2021-04-18 14:02:06 +02:00
ol-eshell.el Backport commit 0a4dc7083 from Emacs 2021-04-19 20:07:28 -04:00
ol-eww.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ol-gnus.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
ol-info.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
ol-irc.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ol-mhe.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
ol-rmail.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
ol-w3m.el ol-w3m: handle w3m-image link information 2021-05-08 07:31:50 -04:00
ol.el Merge branch 'maint' 2021-05-15 10:33:34 +02:00
org-agenda.el Merge branch 'maint' 2021-05-15 10:13:07 +02:00
org-archive.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-attach-git.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
org-attach.el Merge branch 'km/from-emacs-master' 2021-02-14 18:06:23 -05:00
org-capture.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-clock.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-colview.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-compat.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-crypt.el Backport commit 7d0dc3183 from Emacs 2021-03-14 17:54:17 -04:00
org-ctags.el Backport commit 0a4dc7083 from Emacs 2021-04-19 20:07:28 -04:00
org-datetree.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-duration.el duration: Avoid recursive load error 2021-01-04 00:30:00 -05:00
org-element.el Merge branch 'maint' 2021-04-19 18:19:29 +02:00
org-entities.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-faces.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-feed.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-footnote.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-goto.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-habit.el Update copyright year to 2021 2021-01-01 14:59:01 -05:00
org-id.el lisp/org-id.el: Small enhancements 2021-05-15 09:57:45 +02:00
org-indent.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-inlinetask.el Merge branch 'maint' 2021-05-15 09:58:06 +02:00
org-install.el Use lexical-binding cookie in some trivial files 2021-01-24 22:36:30 -05:00
org-keys.el Replace `org-speed-commands-user' by `org-speed-commands' 2021-05-03 16:30:04 +02:00
org-lint.el lint: Silence byte-compiler 2021-04-19 02:12:11 +02:00
org-list.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-macro.el macro: Fix modification-time macro 2021-04-19 01:11:37 +02:00
org-macs.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-mobile.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-mouse.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-num.el * lisp/org-agenda.el: Use lexical-binding 2021-03-09 22:56:33 -05:00
org-pcomplete.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-plot.el org-plot: Fix calling at start of #+plot line 2021-05-09 23:49:46 +08:00
org-protocol.el Merge branch 'maint' 2021-04-28 09:23:29 +02:00
org-refile.el Merge branch 'maint' 2021-05-15 10:33:34 +02:00
org-src.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-table.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org-tempo.el Backport commit a0854f939 from Emacs 2021-03-14 17:57:07 -04:00
org-timer.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
org.el Use cache in org-up-heading-safe 2021-05-15 13:58:05 +02:00
ox-ascii.el Add Nicolas as the maintainer for a few ox-*.el files 2021-05-03 06:41:56 +02:00
ox-beamer.el Add Nicolas as the maintainer for a few ox-*.el files 2021-05-03 06:41:56 +02:00
ox-html.el Merge branch 'maint' 2021-05-08 09:37:36 +02:00
ox-icalendar.el Update Carsten's email address in some files 2021-05-07 16:50:57 +02:00
ox-latex.el Merge branch 'maint' 2021-04-06 13:50:46 +02:00
ox-man.el Backport commit 0a4dc7083 from Emacs 2021-04-19 20:07:28 -04:00
ox-md.el lisp/ox-md.el: Mark some arguments as unused 2021-05-15 10:02:09 +02:00
ox-odt.el Merge branch 'km/from-emacs-master' 2021-03-14 22:07:30 -04:00
ox-org.el Add Nicolas as the maintainer for a few ox-*.el files 2021-05-03 06:41:56 +02:00
ox-publish.el Add Nicolas as the maintainer for a few ox-*.el files 2021-05-03 06:41:56 +02:00
ox-texinfo.el Add Nicolas as the maintainer for a few ox-*.el files 2021-05-03 06:41:56 +02:00
ox.el lisp/ox.el (org-export-to-file): Don't load the major mode 2021-05-03 19:23:39 +02:00