Christian Moe <m...@christianmoe.com> writes: > Thanks! I attach a profile report (for a largeish file with 67 tags > across 1515 headings, 17K+ lines, 18–36 seconds wait to get tags). > > ... > I tried starting emacs with an empty .emacs file; it didn't solve the > problem, so I haven't located any problem in my config. (Starting emacs > with 'emacs -Q' did help - but only because it threw me back to built-in > org 9.3.) > > I experimented with generating simulated Org documents with varying > numbers of tagged headings (n=500, 1000, ... 5000) and doing > (benchmark-run (org-get-buffer-tags)) in them. The time needed to get > the tags seems to grow polynomially with n^2.
The underlying also is NLogN, not N^2. And it cannot be avl-tree that shows up in the profile - avl-tree code is built-in and it is well-tested, with NLogN worst case complexity. What is fishy is that GC takes 80% of the time. It is not normal. May you try to clear ELPA directory completely, start emacs -Q, and install Org mode? Just to make sure that there are no issues with mixed compilation. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>