karlicoss / orgparse

Python module for reading Emacs org-mode files
https://orgparse.readthedocs.org
BSD 2-Clause "Simplified" License
371 stars 43 forks source link

speedup parsing #27

Open karlicoss opened 3 years ago

karlicoss commented 3 years ago

Not that it's slow, but making it even faster wouldn't hurt. Or at least setting up some proper benchmarks.

https://github.com/org-roam/test-org-files is a good source of test files

py-spy output from parsing a bunch of files:

output

Note that iterative parsing (using generators) makes it a bit misleading

_iparse_timestamps appears as a child call of _iparse_repeated_tasks

Tried replacing re with regex (https://pypi.org/project/regex), but didn't have any effect