emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ANN] Lazy cache synchronization
@ 2014-02-20 22:08 Nicolas Goaziou
  2014-02-26 13:33 ` Michael Brand
  2014-02-26 13:49 ` Nicolas Richard
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2014-02-20 22:08 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-20 22:08 [ANN] Lazy cache synchronization Nicolas Goaziou
@ 2014-02-26 13:33 ` Michael Brand
  2014-02-26 13:58   ` Nicolas Goaziou
  2014-02-26 13:49 ` Nicolas Richard
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Brand @ 2014-02-26 13:33 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

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

Hi Nicolas

On Thu, Feb 20, 2014 at 11:08 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> I just pushed an update for parser cache.

The related commit release_8.2.5h-642-geed0500

    commit eed0500913a3534a32abfd5864cf674d9d0cdf64
    Author: Nicolas Goaziou <n.goaziou@gmail.com>
    Date:   Fri Jan 31 01:14:44 2014 +0100

        org-element: Implement lazy cache synchronization

on master is a regression for find-file of an Org file containing the
header

* Definition of <<<foo>>> and <<<bar>>>

Michael

[-- Attachment #2: Backtrace.txt --]
[-- Type: text/plain, Size: 21226 bytes --]

Debugger entered--Lisp error: (wrong-type-argument hash-table-p nil)
  gethash((headline (:raw-value "Summary of <<<foo>>> and <<<bar>>>" :begin 1 :end 38 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :CATEGORY nil :title "Summary of <<<foo>>> and <<<bar>>>")) nil)
  (and (org-element--cache-active-p) (gethash element org-element--cache-objects))
  (let* ((restriction (org-element-restriction type)) (parent element) (candidates (quote initial)) (cache (and (org-element--cache-active-p) (gethash element org-element--cache-objects))) objects-data next) (prog1 (catch (quote exit) (while t (if next nil (let ((data ...)) (if data (setq candidates ...) (setq cache ...)))) (if (or next (eq (quote initial) candidates)) (progn (setq candidates (org-element--get-next-object-candidates restriction candidates)) (setcar (cdr objects-data) candidates))) (let ((closest (and candidates ...))) (if (or (not closest) (> ... origin)) (catch (quote found) (progn ...)) (goto-char (cdr closest)) (setq next (funcall ...)) (let* (...) (setcdr ... ...)))) (let ((cbeg (org-element-property :contents-begin next)) (cend (org-element-property :contents-end next)) (obj-end (org-element-property :end next))) (cond ((<= obj-end origin) (goto-char obj-end)) ((or ... ... ...) (org-element-put-property next :parent parent) (throw ... next)) (t (goto-char cbeg) (narrow-to-region ... cend) (org-element-put-property next :parent parent) (setq parent next restriction ... next nil objects-data nil candidates ...)))))) (org-element--cache-put element cache)))
  (let* ((origin (point)) (element (or element (org-element-at-point))) (type (org-element-type element))) (cond ((let ((post (org-element-property :post-affiliated element))) (and post (< origin post))) (beginning-of-line) (let ((case-fold-search t)) (looking-at org-element--affiliated-re)) (cond ((not (member-ignore-case (match-string 1) org-element-parsed-keywords)) (throw (quote objects-forbidden) element)) ((< (match-end 0) origin) (narrow-to-region (match-end 0) (line-end-position))) ((and (match-beginning 2) (>= origin (match-beginning 2)) (< origin (match-end 2))) (narrow-to-region (match-beginning 2) (match-end 2))) (t (throw (quote objects-forbidden) element))) (setq type (quote keyword))) ((eq type (quote item)) (let ((tag (org-element-property :tag element))) (if (not tag) (throw (quote objects-forbidden) element) (beginning-of-line) (search-forward tag (line-end-position)) (goto-char (match-beginning 0)) (if (and (>= origin ...) (< origin ...)) (narrow-to-region (point) (match-end 0)) (throw (quote objects-forbidden) element))))) ((memq type (quote (headline inlinetask))) (goto-char (org-element-property :begin element)) (skip-chars-forward "* ") (if (and (>= origin (point)) (< origin (line-end-position))) (narrow-to-region (point) (line-end-position)) (throw (quote objects-forbidden) element))) ((memq type (quote (paragraph table-row verse-block))) (let ((cbeg (org-element-property :contents-begin element)) (cend (org-element-property :contents-end element))) (if (and cbeg cend (>= origin cbeg) (or (< origin cend) (and ... ...))) (narrow-to-region cbeg cend) (throw (quote objects-forbidden) element)))) ((eq type (quote keyword)) (if (not (member (org-element-property :key element) org-element-document-properties)) (throw (quote objects-forbidden) element) (beginning-of-line) (search-forward ":") (if (and (>= origin (point)) (< origin (line-end-position))) (narrow-to-region (point) (line-end-position)) (throw (quote objects-forbidden) element)))) ((eq type (quote planning)) (progn (let ((--dolist-tail-- (quote ...)) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (let (...) (if ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (throw (quote objects-forbidden) element)) (t (throw (quote objects-forbidden) element))) (goto-char (point-min)) (let* ((restriction (org-element-restriction type)) (parent element) (candidates (quote initial)) (cache (and (org-element--cache-active-p) (gethash element org-element--cache-objects))) objects-data next) (prog1 (catch (quote exit) (while t (if next nil (let (...) (if data ... ...))) (if (or next (eq ... candidates)) (progn (setq candidates ...) (setcar ... candidates))) (let ((closest ...)) (if (or ... ...) (catch ... ...) (goto-char ...) (setq next ...) (let* ... ...))) (let ((cbeg ...) (cend ...) (obj-end ...)) (cond (... ...) (... ... ...) (t ... ... ... ...))))) (org-element--cache-put element cache))))
  (save-restriction (widen) (let* ((origin (point)) (element (or element (org-element-at-point))) (type (org-element-type element))) (cond ((let ((post (org-element-property :post-affiliated element))) (and post (< origin post))) (beginning-of-line) (let ((case-fold-search t)) (looking-at org-element--affiliated-re)) (cond ((not (member-ignore-case ... org-element-parsed-keywords)) (throw (quote objects-forbidden) element)) ((< (match-end 0) origin) (narrow-to-region (match-end 0) (line-end-position))) ((and (match-beginning 2) (>= origin ...) (< origin ...)) (narrow-to-region (match-beginning 2) (match-end 2))) (t (throw (quote objects-forbidden) element))) (setq type (quote keyword))) ((eq type (quote item)) (let ((tag (org-element-property :tag element))) (if (not tag) (throw (quote objects-forbidden) element) (beginning-of-line) (search-forward tag (line-end-position)) (goto-char (match-beginning 0)) (if (and ... ...) (narrow-to-region ... ...) (throw ... element))))) ((memq type (quote (headline inlinetask))) (goto-char (org-element-property :begin element)) (skip-chars-forward "* ") (if (and (>= origin (point)) (< origin (line-end-position))) (narrow-to-region (point) (line-end-position)) (throw (quote objects-forbidden) element))) ((memq type (quote (paragraph table-row verse-block))) (let ((cbeg (org-element-property :contents-begin element)) (cend (org-element-property :contents-end element))) (if (and cbeg cend (>= origin cbeg) (or ... ...)) (narrow-to-region cbeg cend) (throw (quote objects-forbidden) element)))) ((eq type (quote keyword)) (if (not (member (org-element-property :key element) org-element-document-properties)) (throw (quote objects-forbidden) element) (beginning-of-line) (search-forward ":") (if (and (>= origin ...) (< origin ...)) (narrow-to-region (point) (line-end-position)) (throw (quote objects-forbidden) element)))) ((eq type (quote planning)) (progn (let ((--dolist-tail-- ...) p) (while --dolist-tail-- (setq p ...) (let ... ...) (setq --dolist-tail-- ...)))) (throw (quote objects-forbidden) element)) (t (throw (quote objects-forbidden) element))) (goto-char (point-min)) (let* ((restriction (org-element-restriction type)) (parent element) (candidates (quote initial)) (cache (and (org-element--cache-active-p) (gethash element org-element--cache-objects))) objects-data next) (prog1 (catch (quote exit) (while t (if next nil (let ... ...)) (if (or next ...) (progn ... ...)) (let (...) (if ... ... ... ... ...)) (let (... ... ...) (cond ... ... ...)))) (org-element--cache-put element cache)))))
  (save-excursion (save-restriction (widen) (let* ((origin (point)) (element (or element (org-element-at-point))) (type (org-element-type element))) (cond ((let ((post ...)) (and post (< origin post))) (beginning-of-line) (let ((case-fold-search t)) (looking-at org-element--affiliated-re)) (cond ((not ...) (throw ... element)) ((< ... origin) (narrow-to-region ... ...)) ((and ... ... ...) (narrow-to-region ... ...)) (t (throw ... element))) (setq type (quote keyword))) ((eq type (quote item)) (let ((tag ...)) (if (not tag) (throw ... element) (beginning-of-line) (search-forward tag ...) (goto-char ...) (if ... ... ...)))) ((memq type (quote (headline inlinetask))) (goto-char (org-element-property :begin element)) (skip-chars-forward "* ") (if (and (>= origin ...) (< origin ...)) (narrow-to-region (point) (line-end-position)) (throw (quote objects-forbidden) element))) ((memq type (quote (paragraph table-row verse-block))) (let ((cbeg ...) (cend ...)) (if (and cbeg cend ... ...) (narrow-to-region cbeg cend) (throw ... element)))) ((eq type (quote keyword)) (if (not (member ... org-element-document-properties)) (throw (quote objects-forbidden) element) (beginning-of-line) (search-forward ":") (if (and ... ...) (narrow-to-region ... ...) (throw ... element)))) ((eq type (quote planning)) (progn (let (... p) (while --dolist-tail-- ... ... ...))) (throw (quote objects-forbidden) element)) (t (throw (quote objects-forbidden) element))) (goto-char (point-min)) (let* ((restriction (org-element-restriction type)) (parent element) (candidates (quote initial)) (cache (and (org-element--cache-active-p) (gethash element org-element--cache-objects))) objects-data next) (prog1 (catch (quote exit) (while t (if next nil ...) (if ... ...) (let ... ...) (let ... ...))) (org-element--cache-put element cache))))))
  (catch (quote objects-forbidden) (save-excursion (save-restriction (widen) (let* ((origin (point)) (element (or element (org-element-at-point))) (type (org-element-type element))) (cond ((let (...) (and post ...)) (beginning-of-line) (let (...) (looking-at org-element--affiliated-re)) (cond (... ...) (... ...) (... ...) (t ...)) (setq type (quote keyword))) ((eq type (quote item)) (let (...) (if ... ... ... ... ... ...))) ((memq type (quote ...)) (goto-char (org-element-property :begin element)) (skip-chars-forward "* ") (if (and ... ...) (narrow-to-region ... ...) (throw ... element))) ((memq type (quote ...)) (let (... ...) (if ... ... ...))) ((eq type (quote keyword)) (if (not ...) (throw ... element) (beginning-of-line) (search-forward ":") (if ... ... ...))) ((eq type (quote planning)) (progn (let ... ...)) (throw (quote objects-forbidden) element)) (t (throw (quote objects-forbidden) element))) (goto-char (point-min)) (let* ((restriction (org-element-restriction type)) (parent element) (candidates (quote initial)) (cache (and ... ...)) objects-data next) (prog1 (catch (quote exit) (while t ... ... ... ...)) (org-element--cache-put element cache)))))))
  org-element-context()
  (let ((obj (org-element-context))) (if (memq (org-element-type obj) (quote (radio-target target))) (progn (add-to-list (quote rtn) (downcase (org-element-property :value obj))))))
  (while (re-search-forward re nil t) (backward-char) (let ((obj (org-element-context))) (if (memq (org-element-type obj) (quote (radio-target target))) (progn (add-to-list (quote rtn) (downcase (org-element-property :value obj)))))))
  (save-excursion (goto-char (point-min)) (while (re-search-forward re nil t) (backward-char) (let ((obj (org-element-context))) (if (memq (org-element-type obj) (quote (radio-target target))) (progn (add-to-list (quote rtn) (downcase (org-element-property :value obj))))))) rtn)
  (let ((re (if radio org-radio-target-regexp org-target-regexp)) rtn) (save-excursion (goto-char (point-min)) (while (re-search-forward re nil t) (backward-char) (let ((obj (org-element-context))) (if (memq (org-element-type obj) (quote (radio-target target))) (progn (add-to-list (quote rtn) (downcase ...)))))) rtn))
  org-all-targets(radio)
  (org-make-target-link-regexp (org-all-targets (quote radio)))
  (setq org-target-link-regexp (org-make-target-link-regexp (org-all-targets (quote radio))))
  (progn (setq org-target-link-regexp (org-make-target-link-regexp (org-all-targets (quote radio)))) (org-restart-font-lock))
  (if (memq (quote radio) org-activate-links) (progn (setq org-target-link-regexp (org-make-target-link-regexp (org-all-targets (quote radio)))) (org-restart-font-lock)))
  org-update-radio-target-regexp()
  (let ((delay-mode-hooks t)) (outline-mode) (setq major-mode (quote org-mode)) (setq mode-name "Org") (progn (if (get (quote outline-mode) (quote mode-class)) (put (quote org-mode) (quote mode-class) (get (quote outline-mode) (quote mode-class)))) (if (keymap-parent org-mode-map) nil (set-keymap-parent org-mode-map (current-local-map))) (let ((parent (char-table-parent org-mode-syntax-table))) (if (and parent (not (eq parent (standard-syntax-table)))) nil (set-char-table-parent org-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get org-mode-abbrev-table :parents) (eq org-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put org-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map org-mode-map) (set-syntax-table org-mode-syntax-table) (setq local-abbrev-table org-mode-abbrev-table) (if (featurep (quote xemacs)) (if (boundp (quote outline-mode-menu-heading)) (progn (easy-menu-remove outline-mode-menu-heading) (easy-menu-remove outline-mode-menu-show) (easy-menu-remove outline-mode-menu-hide))) (define-key org-mode-map [menu-bar headings] (quote undefined)) (define-key org-mode-map [menu-bar hide] (quote undefined)) (define-key org-mode-map [menu-bar show] (quote undefined))) (org-load-modules-maybe) (easy-menu-add org-org-menu) (easy-menu-add org-tbl-menu) (org-install-agenda-files-menu) (if org-descriptive-links (add-to-invisibility-spec (quote (org-link)))) (add-to-invisibility-spec (quote (org-cwidth))) (add-to-invisibility-spec (quote (org-hide-block . t))) (if (featurep (quote xemacs)) (progn (org-set-local (quote line-move-ignore-invisible) t))) (org-set-local (quote outline-regexp) org-outline-regexp) (org-set-local (quote outline-level) (quote org-outline-level)) (setq bidi-paragraph-direction (quote left-to-right)) (if (and org-ellipsis (fboundp (quote set-display-table-slot)) (boundp (quote buffer-display-table)) (fboundp (quote make-glyph-code))) (progn (if org-display-table nil (setq org-display-table (make-display-table))) (set-display-table-slot org-display-table 4 (vconcat (mapcar (function (lambda ... ...)) (if (stringp org-ellipsis) org-ellipsis "...")))) (setq buffer-display-table org-display-table))) (org-set-regexps-and-options-for-tags) (org-set-regexps-and-options) (org-set-font-lock-defaults) (if (and org-tag-faces (not org-tags-special-faces-re)) (progn (org-set-tag-faces (quote org-tag-faces) org-tag-faces))) (org-set-local (quote calc-embedded-open-mode) "# ") (modify-syntax-entry 64 "w") (modify-syntax-entry 34 "\"") (if org-startup-truncated (setq truncate-lines t)) (if org-startup-indented (progn (require (quote org-indent)) (org-indent-mode 1))) (org-set-local (quote font-lock-unfontify-region-function) (quote org-unfontify-region)) (org-set-local (quote org-table-may-need-update) t) (org-add-hook (quote before-change-functions) (quote org-before-change-function) nil (quote local)) (org-add-hook (quote kill-buffer-hook) (quote org-check-running-clock) nil (quote local)) (org-macro-initialize-templates) (org-update-radio-target-regexp) (org-set-local (quote indent-line-function) (quote org-indent-line)) (org-set-local (quote indent-region-function) (quote org-indent-region)) (org-setup-filling) (org-setup-comments-handling) (org-element-cache-reset) (org-set-local (quote beginning-of-defun-function) (quote org-backward-element)) (org-set-local (quote end-of-defun-function) (quote org-forward-element)) (org-set-local (quote next-error-function) (quote org-occur-next-match)) (if org-enforce-todo-dependencies (add-hook (quote org-blocker-hook) (quote org-block-todo-from-children-or-siblings-or-parent)) (remove-hook (quote org-blocker-hook) (quote org-block-todo-from-children-or-siblings-or-parent))) (if org-enforce-todo-checkbox-dependencies (add-hook (quote org-blocker-hook) (quote org-block-todo-from-checkboxes)) (remove-hook (quote org-blocker-hook) (quote org-block-todo-from-checkboxes))) (org-set-local (quote align-mode-rules-list) (quote ((org-in-buffer-settings (regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+") (modes quote (org-mode)))))) (org-set-local (quote imenu-create-index-function) (quote org-imenu-get-tree)) (if (or (featurep (quote xemacs)) (not (boundp (quote outline-isearch-open-invisible-function)))) (org-add-hook (quote isearch-mode-end-hook) (quote org-isearch-end) (quote append) (quote local)) (org-set-local (quote outline-isearch-open-invisible-function) (function (lambda (&rest ignore) (org-show-context (quote isearch))))) (org-add-hook (quote isearch-mode-end-hook) (quote org-fix-ellipsis-at-bol) (quote append) (quote local))) ...)
  (progn (make-local-variable (quote delay-mode-hooks)) (let ((delay-mode-hooks t)) (outline-mode) (setq major-mode (quote org-mode)) (setq mode-name "Org") (progn (if (get (quote outline-mode) (quote mode-class)) (put (quote org-mode) (quote mode-class) (get (quote outline-mode) (quote mode-class)))) (if (keymap-parent org-mode-map) nil (set-keymap-parent org-mode-map (current-local-map))) (let ((parent (char-table-parent org-mode-syntax-table))) (if (and parent (not (eq parent ...))) nil (set-char-table-parent org-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get org-mode-abbrev-table :parents) (eq org-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put org-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map org-mode-map) (set-syntax-table org-mode-syntax-table) (setq local-abbrev-table org-mode-abbrev-table) (if (featurep (quote xemacs)) (if (boundp (quote outline-mode-menu-heading)) (progn (easy-menu-remove outline-mode-menu-heading) (easy-menu-remove outline-mode-menu-show) (easy-menu-remove outline-mode-menu-hide))) (define-key org-mode-map [menu-bar headings] (quote undefined)) (define-key org-mode-map [menu-bar hide] (quote undefined)) (define-key org-mode-map [menu-bar show] (quote undefined))) (org-load-modules-maybe) (easy-menu-add org-org-menu) (easy-menu-add org-tbl-menu) (org-install-agenda-files-menu) (if org-descriptive-links (add-to-invisibility-spec (quote (org-link)))) (add-to-invisibility-spec (quote (org-cwidth))) (add-to-invisibility-spec (quote (org-hide-block . t))) (if (featurep (quote xemacs)) (progn (org-set-local (quote line-move-ignore-invisible) t))) (org-set-local (quote outline-regexp) org-outline-regexp) (org-set-local (quote outline-level) (quote org-outline-level)) (setq bidi-paragraph-direction (quote left-to-right)) (if (and org-ellipsis (fboundp (quote set-display-table-slot)) (boundp (quote buffer-display-table)) (fboundp (quote make-glyph-code))) (progn (if org-display-table nil (setq org-display-table (make-display-table))) (set-display-table-slot org-display-table 4 (vconcat (mapcar (function ...) (if ... org-ellipsis "...")))) (setq buffer-display-table org-display-table))) (org-set-regexps-and-options-for-tags) (org-set-regexps-and-options) (org-set-font-lock-defaults) (if (and org-tag-faces (not org-tags-special-faces-re)) (progn (org-set-tag-faces (quote org-tag-faces) org-tag-faces))) (org-set-local (quote calc-embedded-open-mode) "# ") (modify-syntax-entry 64 "w") (modify-syntax-entry 34 "\"") (if org-startup-truncated (setq truncate-lines t)) (if org-startup-indented (progn (require (quote org-indent)) (org-indent-mode 1))) (org-set-local (quote font-lock-unfontify-region-function) (quote org-unfontify-region)) (org-set-local (quote org-table-may-need-update) t) (org-add-hook (quote before-change-functions) (quote org-before-change-function) nil (quote local)) (org-add-hook (quote kill-buffer-hook) (quote org-check-running-clock) nil (quote local)) (org-macro-initialize-templates) (org-update-radio-target-regexp) (org-set-local (quote indent-line-function) (quote org-indent-line)) (org-set-local (quote indent-region-function) (quote org-indent-region)) (org-setup-filling) (org-setup-comments-handling) (org-element-cache-reset) (org-set-local (quote beginning-of-defun-function) (quote org-backward-element)) (org-set-local (quote end-of-defun-function) (quote org-forward-element)) (org-set-local (quote next-error-function) (quote org-occur-next-match)) (if org-enforce-todo-dependencies (add-hook (quote org-blocker-hook) (quote org-block-todo-from-children-or-siblings-or-parent)) (remove-hook (quote org-blocker-hook) (quote org-block-todo-from-children-or-siblings-or-parent))) (if org-enforce-todo-checkbox-dependencies (add-hook (quote org-blocker-hook) (quote org-block-todo-from-checkboxes)) (remove-hook (quote org-blocker-hook) (quote org-block-todo-from-checkboxes))) (org-set-local (quote align-mode-rules-list) (quote ((org-in-buffer-settings (regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+") (modes quote (org-mode)))))) (org-set-local (quote imenu-create-index-function) (quote org-imenu-get-tree)) (if (or (featurep (quote xemacs)) (not (boundp (quote outline-isearch-open-invisible-function)))) (org-add-hook (quote isearch-mode-end-hook) (quote org-isearch-end) (quote append) (quote local)) (org-set-local (quote outline-isearch-open-invisible-function) (function (lambda (&rest ignore) (org-show-context (quote isearch))))) (org-add-hook (quote isearch-mode-end-hook) (quote org-fix-ellipsis-at-bol) (quote append) (quote local))) ...))
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer x.org> "/z/x.org" nil nil "~/z/x.org" (3164340 36))
  find-file-noselect("/z/x.org" nil nil t)
  find-file("/z/x.org" t)
  call-interactively(find-file nil nil)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-20 22:08 [ANN] Lazy cache synchronization Nicolas Goaziou
  2014-02-26 13:33 ` Michael Brand
@ 2014-02-26 13:49 ` Nicolas Richard
  2014-02-26 15:59   ` Bastien
  2014-02-27  4:25   ` Daniel Clemente
  1 sibling, 2 replies; 8+ messages in thread
From: Nicolas Richard @ 2014-02-26 13:49 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> 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.

This seems to be an awesome news ! I can hardly believe you manage to
find the time to do this.

I'm sorry that this is only a "thank you" message (vs, e.g., actual work
from me in the directions you suggest), it certainly deserves more than
that, but I'd find it sad if it had no answer at all.

-- 
Nico.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-26 13:33 ` Michael Brand
@ 2014-02-26 13:58   ` Nicolas Goaziou
  2014-02-26 14:07     ` Michael Brand
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2014-02-26 13:58 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode List

Hello,

Michael Brand <michael.ch.brand@gmail.com> writes:

> The related commit release_8.2.5h-642-geed0500
>
>     commit eed0500913a3534a32abfd5864cf674d9d0cdf64
>     Author: Nicolas Goaziou <n.goaziou@gmail.com>
>     Date:   Fri Jan 31 01:14:44 2014 +0100
>
>         org-element: Implement lazy cache synchronization
>
> on master is a regression for find-file of an Org file containing the
> header
>
> * Definition of <<<foo>>> and <<<bar>>>

It should be fixed. Thank you for reporting it.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-26 13:58   ` Nicolas Goaziou
@ 2014-02-26 14:07     ` Michael Brand
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Brand @ 2014-02-26 14:07 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Hi Nicolas

On Wed, Feb 26, 2014 at 2:58 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> It should be fixed. Thank you for reporting it.

Yes, thank you.

Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-26 13:49 ` Nicolas Richard
@ 2014-02-26 15:59   ` Bastien
  2014-02-27  4:25   ` Daniel Clemente
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2014-02-26 15:59 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: Org Mode List, Nicolas Goaziou

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> I'm sorry that this is only a "thank you" message (vs, e.g., actual work
> from me in the directions you suggest), it certainly deserves more than
> that, but I'd find it sad if it had no answer at all.

I guess most people are like me: there is so much to thank Nicolas
for that we don't know where to start.

But you're right, that's a great structural achievement, so *thank*
you Nicolas!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-26 13:49 ` Nicolas Richard
  2014-02-26 15:59   ` Bastien
@ 2014-02-27  4:25   ` Daniel Clemente
  2014-02-27  8:05     ` Andreas Leha
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Clemente @ 2014-02-27  4:25 UTC (permalink / raw)
  To: Org Mode List; +Cc: Nicolas Goaziou


> Nicolas Goaziou <n.goaziou@gmail.com> writes:
> > 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.
> 

  I had been regularly tracking the performance of org-mode for big files, e.g. a 18 Mb one with 380k lines (created only to test this).

  1. With last month's org-mode in emacs 24 I needed more than 5 minutes to open it, and then moving around the file was too slow to be comfortable (local editing was however acceptable).
  2. With the current one, it's only 10 seconds loading time, local editing is still fast, and jumping around sections takes at most 2 seconds per move.
  
  So this change has made me stop worrying about files growing too fast, at least for many years. Thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ANN] Lazy cache synchronization
  2014-02-27  4:25   ` Daniel Clemente
@ 2014-02-27  8:05     ` Andreas Leha
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Leha @ 2014-02-27  8:05 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nicolas,

Daniel Clemente <n142857@gmail.com> writes:

>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>> > 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.
>> 
>
>   I had been regularly tracking the performance of org-mode for big
> files, e.g. a 18 Mb one with 380k lines (created only to test this).
>
>   1. With last month's org-mode in emacs 24 I needed more than 5
> minutes to open it, and then moving around the file was too slow to be
> comfortable (local editing was however acceptable).
>   2. With the current one, it's only 10 seconds loading time, local
> editing is still fast, and jumping around sections takes at most 2
> seconds per move.
>   
>   So this change has made me stop worrying about files growing too fast, at least for many years. Thanks!


I do not have measurements, but Org mode (especially navigation) feels so
much faster now.  Thanks a lot also from my side!

- Andreas

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-27  8:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 22:08 [ANN] Lazy cache synchronization Nicolas Goaziou
2014-02-26 13:33 ` Michael Brand
2014-02-26 13:58   ` Nicolas Goaziou
2014-02-26 14:07     ` Michael Brand
2014-02-26 13:49 ` Nicolas Richard
2014-02-26 15:59   ` Bastien
2014-02-27  4:25   ` Daniel Clemente
2014-02-27  8:05     ` Andreas Leha

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).