org-query
org-query copied to clipboard
Too slow for my org-files
Can we improve the performance?
I have written leoc/org-helpers. I find your implementation and flexibility much better, but it seems to be much slower than my simple attempt of generalizing the ideas of Bernt Hansen. Have you run into problems concerning performance? I am not that deep into hacking org-mode, so maybe we could discuss some ways of improving performance? :smile: I'd be happy to do some implementation then :+1:
Some things I can think of:
- not finding the parent multiple times
- expanding macros to combined queries (finding parent once, doing the queries on this one)
- using basic buffer functions instead of org-functions (those seem to be a little slower)
- more caching
Cheers!
Hi, thanks for opening this issue and sorry for the late reply. I use one 600 kb org file and I have noticed it is not fast. I have not implemented anything to improve the performance, but I have done some experiments with memoization of functions that were called a lot according to a profiling. I don't remember what the results were though... But I think you are right about the possible improvements. I would suggest profiling the code again to identify the functions that are called the most and go from there.
I would love to help out making this more performant, but my second daughter was born last month so I won't have a lot of time the coming months. I will keep watching my PR's and issues so I can merge and provide information were I can.
Thanks again!
I just submitted https://github.com/remyhonig/org-query/pull/5 which may improve performance to a small degree.
For memoization, the memoize library might be helpful. It's simple to use and works well in my experience.