Re: [PATCH] Use cache in org-up-heading-safe

2021-05-16 Thread Bastien
Hi Ihor, Ihor Radchenko writes: > Can it be some strange interaction between .el, .elc, or even .eln > files compiled for different Org versions? Mhh... probably -- I'll monitor this closely. -- Bastien

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-15 Thread Ihor Radchenko
Bastien writes: > Debugger entered--Lisp error: (void-variable org--up-heading-cache) > org-up-heading-safe() > Ihor, do you see what's happening here? This is very odd. `org--up-heading-cache' is supposed to be buffer-local variable available in all buffers with default value of nil. Yet, th

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-15 Thread Bastien
Hi, Ihor Radchenko writes: > While testing another patch for agenda fontification, I noticed that > agenda can spend up to half!! time doing org-up-heading-safe. Mostly > inside queries for inherited tags and properties. I encounter a bug with this cache, it seems the buffer-local variable `org

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-15 Thread Bastien
Hi Ihor, Ihor Radchenko writes: > From 08a175752b14f84767a71665773aa64807606af4 Mon Sep 17 00:00:00 2001 > Message-Id: > <08a175752b14f84767a71665773aa64807606af4.1620316036.git.yanta...@gmail.com> > From: Ihor Radchenko > Date: Thu, 6 May 2021 14:13:20 +0800 > Subje

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-10 Thread Ihor Radchenko
Maxim Nikulin writes: > I am trying to minimize number of regexp searches. Mostly it is applied > when information concerning multiple headings is required (agenda, > refile targets). It unlikely will get some benefits during interactive > calls related to single heading. > Having the tree, i

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-08 Thread Maxim Nikulin
On 07/05/2021 09:08, Ihor Radchenko wrote: Maxim Nikulin writes: Did you just replace gethash by avl-tree? Yes Likely my idea is based on a wrong assumption. I hoped that having positions of headers it is possible to avoid jumps (goto-char ...) preceded or followed by regexp matching almost

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-06 Thread Ihor Radchenko
16036.git.yanta...@gmail.com> From: Ihor Radchenko Date: Thu, 6 May 2021 14:13:20 +0800 Subject: [PATCH] Use cache in org-up-heading-safe * lisp/org.el (org-up-heading-safe): Use buffer-local cache to store positions of parent headings. The cache is invalidated when buffer text is changed, a

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-06 Thread Maxim Nikulin
Though I still have not tested the patch, I think, it is an improvement and it is helpful in its current form. I am unable to tell if it follows code style. Despite continuing discussion, I am unsure if it could be significantly better. On 06/05/2021 21:34, Ihor Radchenko wrote: Maxim Nikul

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-06 Thread Ihor Radchenko
t; regexp is taken from original function, so no regression is expected. I do not know either. Actually, I wish if Org mode code base used less literal strings and more regexp variables from org-element.el and org.el. Best, Ihor >From d40b2bbb1dc5113d3085be2fae52ebe5ac1b023d Mon Sep 17 00:00:00 20

Re: [PATCH] Use cache in org-up-heading-safe

2021-05-05 Thread Maxim Nikulin
On 04/05/2021 22:08, Ihor Radchenko wrote: While testing another patch for agenda fontification, I noticed that agenda can spend up to half!! time doing org-up-heading-safe. Mostly inside queries for inherited tags and properties. I managed to make org-up-heading-safe up to 50x faster using pos

[PATCH] Use cache in org-up-heading-safe

2021-05-04 Thread Ihor Radchenko
om: Ihor Radchenko Date: Tue, 4 May 2021 22:55:14 +0800 Subject: [PATCH] Use cache in org-up-heading-safe * lisp/org.el (org-up-heading-safe): Use buffer-local cache to store positions of parent headings. The cache is invalidated when buffer text is changed, according to `buffer-chars-modified-tick&#x