emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] org-element.el; significant optimizations for org-element--inter


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


Attachment: 0001-org-element.el-Make-affiliated-keyword-interpreter-f.patch
Description: Text Data

Attachment: org-ml-postpatch.pdf
Description: Adobe PDF document

Attachment: org-ml-prepatch.pdf
Description: Adobe PDF document

Attachment: benchmark.el
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]