[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Bug: fragile org refile cache
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] Bug: fragile org refile cache |
Date: |
Fri, 30 Apr 2021 00:08:53 +0800 |
Maxim Nikulin <manikulin@gmail.com> writes:
> Curiously my experience is that avoiding this lazy cache with
> backtracking and maintaining custom structure during sequential scan of
> the buffer works several times faster.
My experience is exactly opposite. Or maybe I miss something. Can you
elaborate?
> ... However it is appropriate time to
> populate the cache you mentioned. Unfortunately it is still necessary to
> cleanup heading text, and it consumes significant time.
Did you do any benchmarks? I just tried
Outline path without cache:
(benchmark-run 1
(goto-char (point-min))
(while (re-search-forward "^\\*+" nil t)
(org-get-outline-path t nil))) => (6.051079914 1 0.2864724879999869)
Outline path with cache:
(benchmark-run 1
(goto-char (point-min))
(while (re-search-forward "^\\*+" nil t)
(org-get-outline-path t nil))) => (1.658461165 0 0.0)
Just cleanup heading text:
(benchmark-run 1
(goto-char (point-min))
(while (re-search-forward "^\\*+" nil t)
(let ((case-fold-search nil))
(looking-at org-complex-heading-regexp)
(if (not (match-end 4)) ""
;; Remove statistics cookies.
(org-trim
(org-link-display-format
(replace-regexp-in-string
"\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
(match-string-no-properties 4)))))))) => (0.013364877 0 0.0)
Best,
Ihor
- [PATCH] Bug: fragile org refile cache, Maxim Nikulin, 2021/04/28
- Re: [PATCH] Bug: fragile org refile cache, Samuel Wales, 2021/04/28
- Re: [PATCH] Bug: fragile org refile cache, Ihor Radchenko, 2021/04/28
- Re: [PATCH] Bug: fragile org refile cache, Samuel Wales, 2021/04/28
- Re: [PATCH] Bug: fragile org refile cache, Maxim Nikulin, 2021/04/29
- Re: [PATCH] Bug: fragile org refile cache, Ihor Radchenko, 2021/04/29
- Re: [PATCH] Bug: fragile org refile cache, Maxim Nikulin, 2021/04/29
- Re: [PATCH] Bug: fragile org refile cache,
Ihor Radchenko <=
- Re: [PATCH] Bug: fragile org refile cache, Maxim Nikulin, 2021/04/29
- Re: [PATCH] Bug: fragile org refile cache, Maxim Nikulin, 2021/04/30
- Re: [PATCH] Bug: fragile org refile cache, Ihor Radchenko, 2021/04/29
- Re: [PATCH] Bug: fragile org refile cache, Tim Cross, 2021/04/29
- Re: [PATCH] Bug: fragile org refile cache, Samuel Wales, 2021/04/29