emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Maxim Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] optimize org-refile-get-targets
Date: Sun, 25 Apr 2021 22:24:08 +0700	[thread overview]
Message-ID: <s641iq$iv7$1@ciao.gmane.io> (raw)
In-Reply-To: <87wnsqa6vf.fsf@gnu.org>

On 25/04/2021 19:25, Bastien wrote:
> 
> Are you still using it?  Did anyone tested it?

I realized that I break cache a bit, so the patch should not be applied 
in the current form. I have an idea how to fix it but I have found more 
problems around (independent of my patch). I did not worried since the 
patch did not appeared on updates.orgmode.org (I guess, due to "git 
diff" instead of "git format patch".)

Cache key is regexp. With my patch, level and max-level options share 
the same regexp. I think, cache for both options could be generated as 
for max-level and filtered in the case of "level". It may simplify the code.

I would be grateful for other comments.

I have not realized how to reduce number of regexps inside the loop 
without duplication of some regegexps. I have seen a statement that 
cache for compiled regular expressions in emacs is rather small so 
several patterns used on each cycle is enough to make it useless with 
significant performance penalty.

Other issues:
- Indirect buffer created with C-x 4 c does not reuse cache created for 
the main buffer, so first call in new buffer have to generate its own cache.
- C-u C-c C-j promises to use headings from the buffer, but in the case 
of subtree indirect buffer, headings are not filtered to the narrowed part.
- I have not solved the problem with default option for `org-refile' and 
`org-goto'. Maybe more detailed structure should be stored in history 
and formatted accordingly to current option at the moment of invocation.



  reply	other threads:[~2021-04-25 15:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 17:15 org-refile-use-cache and jumps using org-refile or org-goto Maxim Nikulin
2021-03-03  2:34 ` Samuel Wales
2021-03-04 13:51   ` Maxim Nikulin
2021-03-04 21:03     ` Samuel Wales
2021-03-06 16:15       ` [PATCH] optimize org-refile-get-targets Maxim Nikulin
2021-04-25 12:25         ` Bastien
2021-04-25 15:24           ` Maxim Nikulin [this message]
2021-03-04 14:47 ` org-refile failed due to default option stored by org-goto Maxim Nikulin
2021-03-04 22:53   ` Samuel Wales
2021-03-09 11:57     ` Maxim Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='s641iq$iv7$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).