emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [PATCH] Fix massive slowdown in org-id-find
Date: Tue, 24 Mar 2015 10:02:17 +0100	[thread overview]
Message-ID: <86h9ta3h0m.fsf@example.com> (raw)
In-Reply-To: <87vbhrnz07.fsf@nicolasgoaziou.fr>

Nicolas Goaziou wrote:
> Florian Beck <fb-ZlLO5Ova5IRn68oJJulU0Q@public.gmane.org> writes:
>
>> the recent changes in org-id (presumably
>> 8cdb2eef0f9f98f9e00a5e689decfe341fe0c6ec) lead to a massive slowdown.
>
> Would you mind elaborating a bit? Slow down doing what? In which cases?
> Could you profile it?
>
>> org-id-find is slow as it is, now I find it almost unusable.
>>
>> Attached patch provides a fix.
>
> Thanks. However, your patch is (partly) wrong.
>
>> -	  (re (org-re-property property nil (not value))))
>> -      (catch 'exit
>> -	(while (re-search-forward re nil t)
>> -	  (when (if value (equal value (org-entry-get (point) property nil t))
>> -		  (org-entry-get (point) property nil t))
>> -	    (throw 'exit (progn (org-back-to-heading t) (point)))))))))
>> +	  (re (org-re-property property nil (not value) value)))
>> +      (when (re-search-forward re nil t)
>> +	(org-back-to-heading t)
>> +	(point)))))
>
> Here, it catches false positives, e.g., lines looking like properties in
> example blocks. It also overlooks accumulated values. It should fail
> with "make test".
>
> However, the optional VALUE argument is nice (I think some profiling
> would still be welcome, tho).

For my own information, does one know if it's possible to integrate
profiling tests in ERT?  So that one could write that if test X takes
more than 2 s (for example), the test would fail?

Best regards,
  Seb

-- 
Sebastien Vauban

  reply	other threads:[~2015-03-24  9:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 13:51 Florian Beck
2015-03-23 22:13 ` Nicolas Goaziou
2015-03-24  9:02   ` Sebastien Vauban [this message]
2015-03-24 11:05   ` Florian Beck
2015-03-24 22:49     ` Florian Beck
2015-03-25 11:31       ` Jacob Nielsen
2015-03-25 13:04       ` Nicolas Goaziou
2015-03-30 20:43         ` Florian Beck
2015-03-31 10:01           ` Nicolas Goaziou

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=86h9ta3h0m.fsf@example.com \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).