From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: [ANN] Lazy cache synchronization Date: Thu, 20 Feb 2014 23:08:04 +0100 Message-ID: <87ppmh1lq3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGbmX-0004jk-S9 for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 17:07:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGbmP-0004yi-ER for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 17:07:49 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:64292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGbmP-0004yc-7i for emacs-orgmode@gnu.org; Thu, 20 Feb 2014 17:07:41 -0500 Received: by mail-wi0-f181.google.com with SMTP id hi5so192475wib.8 for ; Thu, 20 Feb 2014 14:07:40 -0800 (PST) Received: from selenimh ([91.224.148.150]) by mx.google.com with ESMTPSA id ga20sm2095383wic.0.2014.02.20.14.07.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Feb 2014 14:07:39 -0800 (PST) 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: Org Mode List Hello, I just pushed an update for parser cache. Until then, synchronization was the weak spot of the cache mechanism, as it happened in one row after each buffer change, with a linear complexity by the number of elements in cache after point. In other words, editing a very large buffer near its end was fast, but slow at its beginning. Now, synchronization happens lazily, which means the cache is only updated when and where needed, or during idle time. Therefore the cache mechanism scales a lot better. Obviously, the more functions use it, the more it is profitable. Hence, it would be nice to rewrite core functions so they use the parser (i.e, `org-element-at-point' and `org-element-context'). For example, functions like `org-in-clocktable-p', `org-in-commented-line', `org-in-indented-comment-line' (which should be merged with the previous one) or `org-in-verbatim-emphasis' are good starting points. If you feel adventurous, synchronization can be controlled with the following variables: - `org-element-cache-sync-idle-time' - `org-element-cache-sync-duration' - `org-element-cache-sync-break' Feedback (or benchmarks) welcome. Regards, -- Nicolas Goaziou