[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [RFC] Simple cache mechanism for `org-element-at-point'
From: |
Carsten Dominik |
Subject: |
Re: [O] [RFC] Simple cache mechanism for `org-element-at-point' |
Date: |
Fri, 4 Oct 2013 11:13:11 +0200 |
Hi Nicolas,
this sounds like a great idea. I have not yet had the time to
test it - but I would like to bring forward two basic worries.
Maybe you have comments on them?
1. Updating on buffer modification hooks sounds like a very
demanding process. You basically add a third expensive process
in addition to font locking and org-indent-mode. My worry is
that this might be very heavy on Emacs and slow down fast workers.
Again, I did not try it, just a worry
2. Do you expect this to be stable enough to deal with buffers that
are invalid in some way or another? Are there any situations in
which the parser could fail and leave some weird state behind?
3. Can you explain what you mean by "except in headline-only commands?
Thank you!
- Carsten
On 3.10.2013, at 23:18, Nicolas Goaziou <address@hidden> wrote:
> Hello,
>
> The following patches introduce a simple cache mechanism for both
> `org-element-at-point' and `org-element-context'. My goal is to make
> them fast enough to be used in most core commands (excepted
> headlines-only commands).
>
> Since a wrong cache can break Org behaviour badly, I would appreciate if
> it could be tested a bit. You can disable cache at any time by setting
> `org-element-use-cache' to nil and reset it with
> `org-element-cache-reset' function.
>
> It may also be interesting to tweak `org-element--cache-sync-idle-time'
> and `org-element--cache-merge-changes-threshold', although I don't
> expect a regular user to do it. Anyway, it may lead to better default
> values.
>
> Since cache is updated upon buffer modification, visibility status
> cannot be cached properly. Since it is also buggy, the first patch
> removes that data altogether.
>
> Feedback welcome.
>
>
> Regards,
>
> --
> Nicolas Goaziou
> <0001-org-element-Remove-folding-status-in-parsed-data.patch><0002-org-element-Implement-caching-for-dynamic-parser.patch>
signature.asc
Description: Message signed with OpenPGP using GPGMail