Anders Johansson <[email protected]> writes: > I had considered to implement some kind of cache in my code, but now I > get this "for free"! I originally didn't use org-scan-tags but some > custom and "simpler" code for scanning, but I am glad I refactored to > use org-scan-tags, because now I get this speedup without a single > code change in orgqda.
You can achieve even better speedup if you directly use org-element-cache-map with :next-re/:fail-re parameters. If you are matching against specific tags, those tags can be used to create a regexp to locate match candidates very quickly. Beware that org-element-cache-map does not work without org-element-use-cache set to t (it is, by default). Best, Ihor
