Restrict Org cache advice to Org 9.5.5 and earlier

Org 9.6.7 does not seem to have these performance issues anymore.
This commit is contained in:
Daniel - 2023-07-19 19:46:27 +02:00
parent 1d33039dde
commit d0aa2bf33d
Signed by: dbo
GPG Key ID: 784AA8DF0CCDF625
1 changed files with 16 additions and 15 deletions

31
init.el
View File

@ -963,21 +963,22 @@
;; parsing all properties of an entry by default. Lets simplify ;; parsing all properties of an entry by default. Lets simplify
;; this to only parse what we are looking for. This makes tag ;; this to only parse what we are looking for. This makes tag
;; search *much* faster! ;; search *much* faster!
(with-eval-after-load 'org (when (version<= org-version "9.5.5")
(define-advice org-cached-entry-get (:around (with-eval-after-load 'org
(orig-fun pom property) (define-advice org-cached-entry-get (:around
speed-up-cache-lookup) (orig-fun pom property)
(ignore orig-fun) speed-up-cache-lookup)
(if (or (eq t org-use-property-inheritance) (ignore orig-fun)
(and (stringp org-use-property-inheritance) (if (or (eq t org-use-property-inheritance)
(let ((case-fold-search t)) (and (stringp org-use-property-inheritance)
(string-match-p org-use-property-inheritance property))) (let ((case-fold-search t))
(and (listp org-use-property-inheritance) (string-match-p org-use-property-inheritance property)))
(member-ignore-case property org-use-property-inheritance))) (and (listp org-use-property-inheritance)
;; Caching is not possible, check it directly. (member-ignore-case property org-use-property-inheritance)))
(org-entry-get pom property 'inherit) ;; Caching is not possible, check it directly.
;; This is different in the original implementation (org-entry-get pom property 'inherit)
(org-entry-get pom property)))) ;; This is different in the original implementation
(org-entry-get pom property)))))
;; Fix (Org 9.5.5): the variable `org-time-was-given' dynamically ;; Fix (Org 9.5.5): the variable `org-time-was-given' dynamically
;; bound to signify when `org-read-date-analyze' has found a hh:mm ;; bound to signify when `org-read-date-analyze' has found a hh:mm