emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Opening an Org file slowed down


From: Nicolas Goaziou
Subject: Re: [O] Opening an Org file slowed down
Date: Tue, 26 Nov 2013 18:28:44 +0100

> Please note that the parsing process is inherently linear, since we're
> in a context-dependent grammar. Thus, there's not much to do about the
> parsing algorithm.
>
> However, the cache is always up-to-date. So, we are not bound to start
> again from headline if we can find a cached element between it and the
> point. The closer, the better.
>
> I think there's room for improvement in this area. An idea could be to
> start `org-element-at-point' with an opportunistic search. Before going
> back to the headline, we could, indeed, `search-backward' on
> `org-element-paragraph-start' a couple of times and check if location
> found is already cached. This would work well when parsing successively
> elements in the same section or when editing the current paragraph.

I implemented it.

`org-element-at-point' runs in a mean constant time now (worst case is
still linear, though).

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]