Hi Lawrence and all,

Lawrence Mitchell <we...@gmx.li> writes:

> org-up-heading-safe                263822      84.507423221  0.0003203198
> org-element--parse-elements        3113        40.774293673  0.0130980705
> org-back-to-heading                1209279     40.394825581  3.340...e-05
> org-element-headline-parser        59033       32.808386543  0.0005557634

Given the above, I wonder how the attached patch would help microoptimizing
`org-up-heading-safe'.  The idea is that maybe we don't need the better error
that `org-up-heading-safe' provides, and the wrapping into (condition-case...)
may slow down things.  I've not tested -- feel free to test!

diff --git a/lisp/org.el b/lisp/org.el
index 8ec6781..619fec4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22901,7 +22901,7 @@ Also, this function will be a lot faster than `outline-up-heading',
 because it relies on stars being the outline starters.  This can really
 make a significant difference in outlines with very many siblings."
   (let (start-level re)
-    (org-back-to-heading t)
+    (outline-back-to-heading t)
     (setq start-level (funcall outline-level))
     (if (equal start-level 1)
 	nil
-- 
 Bastien

Reply via email to