From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [RFC] Simple cache mechanism for `org-element-at-point' Date: Fri, 4 Oct 2013 11:13:11 +0200 Message-ID: <092FB06C-4326-467A-8033-C7712BEE0AEE@gmail.com> References: <87wqlu834i.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_276815C8-6AC9-441B-9F53-3F755F7CB9E1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS1Rt-0004rP-0y for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 05:13:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VS1Rk-00025P-KO for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 05:13:24 -0400 Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]:45265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS1Rk-00024R-Cc for emacs-orgmode@gnu.org; Fri, 04 Oct 2013 05:13:16 -0400 Received: by mail-ee0-f53.google.com with SMTP id b15so1663660eek.40 for ; Fri, 04 Oct 2013 02:13:15 -0700 (PDT) In-Reply-To: <87wqlu834i.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Org Mode List --Apple-Mail=_276815C8-6AC9-441B-9F53-3F755F7CB9E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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 wrote: > Hello, >=20 > 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). >=20 > 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. >=20 > 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. >=20 > 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. >=20 > Feedback welcome. >=20 >=20 > Regards, >=20 > --=20 > Nicolas Goaziou > = <0001-org-element-Remove-folding-status-in-parsed-data.patch><0002-org-ele= ment-Implement-caching-for-dynamic-parser.patch> --Apple-Mail=_276815C8-6AC9-441B-9F53-3F755F7CB9E1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSToanAAoJEO+gg/nAZuwMYf4H+gLmXqmGwUyHFlxCAg2UT35y mJlDzYFrRtXjhYs6aRXuTwmvTO6YBECwjN/od4UWYZAT1BxbRbc5I4yvacJFbBgp J8LfnVpSUPFBlVaYFbLbew0bmsDqwed3tsjufDN0816Bt6cA0wuCg4PsVaI95Fmy YFAxVjaKarA1xZkHXz55izEn+z8Vw5M7+dNSoE1pEh0c+mN6FsxqYA2bMw17bXOe ZnsmYsZt2aIktJCxgfc/4SjmpA+J3mqAqOrNhwXRHjxG1SZtfOidUJa4zz6Qo/kV gAAZjP3URQI8ShzW9P1sAgrnBM+3PuICpa+2xZ9b6DzWA5oafAttEgAt97mhfi8= =q4qO -----END PGP SIGNATURE----- --Apple-Mail=_276815C8-6AC9-441B-9F53-3F755F7CB9E1--