|
From: | Dwarshuis, Nathan J |
Subject: | [PATCH] org-element.el; significant optimizations for org-element--interpret-affiliated-keywords |
Date: | Fri, 29 Nov 2024 17:38:25 -0500 |
User-agent: | mu4e 1.12.7; emacs 29.4 |
Hi all, I noticed that calling `org-element-interpret-data' on objects is generally 5-10x faster than when calling on elements. The reason seems to be that `org-element--interpret-affiliated-keywords' (which is only called on elements) does alot of unnecessary work. Namely, it runs on all elements (including those that should never have an affiliated keyword) and also loops over :standard-properties which should not be relevant here. The attached patch addresses this. I also attached some benchmarks pre and post-patch and accompanying code, which shows many elements (specifically those without children) approaching the execution time of objects. For the graphs, just pay attention to the 'org-element' bars (red); the others were from me trying to optimize the `org-ml` package. Thank you, Nate
0001-org-element.el-Make-affiliated-keyword-interpreter-f.patch
Description: Text Data
org-ml-postpatch.pdf
Description: Adobe PDF document
org-ml-prepatch.pdf
Description: Adobe PDF document
benchmark.el
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |