emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Maxim Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] org-goto slows down org-set-property
Date: Sat, 10 Jul 2021 22:47:49 +0700	[thread overview]
Message-ID: <sccff7$ers$1@ciao.gmane.io> (raw)

It is rather annoying that C-c C-x p `org-set-property' may be quite 
slow if a file is large enough. (I do not consider it huge however.) 
There is noticeable delay before the prompt for property name appears in 
minibuffer. Accidentally I have noticed that sometimes it is fast.

Problem appears after first jump using C-u C-c C-j `org-goto'. Actually 
a jump is not required, it is enough to get jump (refile) targets.

I hope, the following numbers are convincing enough. Second attempt to 
get list of properties is much slower than the first one.

#+begin_src elisp
   (require 'org-refile)
   (let ((org-refile-targets '((nil :maxlevel . 6)))
	(org-refile-use-outline-path 'file)
	(org-refile-use-cache t)
	(iters 10))
     (cons
      (list (org-version))
      (mapcar (lambda (f)
	       (append (list f) (benchmark-run iters (funcall f))))
	     (list #'org-buffer-property-keys
		   #'org-refile-get-targets
		   #'org-buffer-property-keys))))
#+end_src

git master:

#+RESULTS:
| 9.4.6                    |          |    |                     |
| org-buffer-property-keys | 0.065695 |  0 |                 0.0 |
| org-refile-get-targets   | 1.836473 | 12 | 0.39498671199999985 |
| org-buffer-property-keys | 0.563227 |  0 |                 0.0 |

elpa-org system package for Ubuntu-20.04 is even more slower:

#+RESULTS:
| 9.3.1                    |             |    |             |
| org-buffer-property-keys | 0.242574778 |  0 |         0.0 |
| org-refile-get-targets   | 2.669112479 | 13 | 0.285175928 |
| org-buffer-property-keys | 1.231223427 |  0 |         0.0 |

The effect is noticeable for the doc/org-manual.org file from org 
sources though absolute numbers are well below delay that makes 
interaction incomfortable.

In the configuration above effect of `org-refile-use-cache' is crucial, 
contribution of `org-refile-use-outline-path' is noticeable but not so 
important.

My expectation is that neither `org-refile-use-cache' nor `org-goto' 
command should make adding property slower.



             reply	other threads:[~2021-07-10 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 15:47 Maxim Nikulin [this message]
2021-07-11  9:25 ` [BUG] org-goto slows down org-set-property Maxim Nikulin
2021-07-11 11:49   ` Ihor Radchenko
2021-07-11 12:55     ` Maxim Nikulin
2021-07-11 14:20       ` Ihor Radchenko
2021-07-11 15:07         ` Maxim Nikulin
2021-07-11 16:00           ` Ihor Radchenko
2021-07-12 14:59             ` Maxim Nikulin
2021-07-13 14:21               ` John Kitchin

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='sccff7$ers$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).