emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [RFC] Simple cache mechanism for `org-element-at-point'
Date: Fri, 4 Oct 2013 11:13:11 +0200	[thread overview]
Message-ID: <092FB06C-4326-467A-8033-C7712BEE0AEE@gmail.com> (raw)
In-Reply-To: <87wqlu834i.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]

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 <n.goaziou@gmail.com> 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>


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  parent reply	other threads:[~2013-10-04  9:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03 21:18 [RFC] Simple cache mechanism for `org-element-at-point' Nicolas Goaziou
2013-10-04  5:43 ` Eric Abrahamsen
2013-10-04  8:53   ` Nicolas Goaziou
2013-10-04  9:13 ` Carsten Dominik [this message]
2013-10-04 17:15   ` Nicolas Goaziou
2013-10-27  8:52 ` Nicolas Goaziou
2013-10-30 10:06   ` Nicolas Goaziou
2013-10-30 12:39     ` Eric Abrahamsen
2013-11-03 12:39       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=092FB06C-4326-467A-8033-C7712BEE0AEE@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).