[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Very slow getting tags for completion after 9.7 upgrade
From: |
Christian Moe |
Subject: |
Re: Very slow getting tags for completion after 9.7 upgrade |
Date: |
Fri, 07 Jun 2024 20:02:04 +0200 |
User-agent: |
mu4e 1.6.10; emacs 27.1 |
Ihor Radchenko <yantar92@posteo.net> writes:
> Christian Moe <mail@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.
Looks like that did the trick! Even in the monster file, I'm now down to
1.6 seconds, which is absolutely fair given the size of the file.
Thanks for the advice!
Yours,
Christian