emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Morgan Smith <Morgan.J.Smith@outlook.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-make-tags-matcher: Compile returned function
Date: Mon, 29 Apr 2024 16:52:12 +0000	[thread overview]
Message-ID: <87wmogaz7n.fsf@localhost> (raw)
In-Reply-To: <CH3PR84MB3424390023D1A552D57395FAC51B2@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM>

Morgan Smith <Morgan.J.Smith@outlook.com> writes:

> This should result in a nice performance boost when the function is
> called repeatedly (as is often done).
>
> * lisp/org.el (org-make-tags-matcher): Evaluate returned function to
> compile it into a closure.
> ...
> I don't have any rigorous benchmarks but this does make things significantly
> faster.  This actually seems to have a bigger performance impact on
> `org-clock-sum' then my rewrite of `org-clock-sum' I submitted earlier does.
> Which is a little frustrating honestly.
>
> It does involve using the `eval' function which I know is a little taboo.
> Although in this case I don't believe it actually adds any danger.

I am able to reproduce a noticeable ~10% speedup.
Even better approach is byte-compiling the result. It yields ~20%
speedup.

I applied an alternative patch that byte-compiles the returned function.

Handled, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3e11b2eb8

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


      reply	other threads:[~2024-04-29 16:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  0:06 [PATCH] org-make-tags-matcher: Compile returned function Morgan Smith
2024-04-29 16:52 ` Ihor Radchenko [this message]

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=87wmogaz7n.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=Morgan.J.Smith@outlook.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).