From: Carsten Dominik <dominik@science.uva.nl>
To: Adam Spiers <orgmode@adamspiers.org>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: proposal: defconst/defcustom org-tags-regexp
Date: Sun, 2 Sep 2007 09:30:44 +0200 [thread overview]
Message-ID: <c9e19e991f2d975f6dcf98852a77c6a8@science.uva.nl> (raw)
In-Reply-To: <20070901110123.GA32102@atlantic.linksys.moosehall>
On Sep 1, 2007, at 13:01, Adam Spiers wrote:
> Ah, I was assuming that the elisp interpreter was intelligent enough
> that if you did a concat of two or more constants, it would only build
> the regexp the first time, similar to m//o in Perl. Is that not the
> case? Or maybe it only performs this optimisation if you
> byte-compile? I found this in the elisp manual:
>
> -- Special Form: eval-when-compile body...
> This form marks BODY to be evaluated at compile time but not when
> the compiled program is loaded. The result of evaluation by the
> compiler becomes a constant which appears in the compiled program.
> If you load the source file, rather than compiling it, BODY is
> evaluated normally.
>
> If you have a constant that needs some calculation to produce,
> `eval-when-compile' can do that at compile-time. For example,
>
> (defvar my-regexp
> (eval-when-compile (regexp-opt '("aaa" "aba" "abb"))))
>
> Maybe I should practice what I preach and use mercurial to start an
> experimental branch to look at the impact on performance of doing this
> refactoring :-)
I made some tests a while ago, and the impact was very small.
- Carsten
prev parent reply other threads:[~2007-09-02 7:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 13:21 proposal: defconst/defcustom org-tags-regexp Adam Spiers
2007-07-18 21:24 ` Carsten Dominik
2007-07-19 13:08 ` Eddward DeVilla
2007-07-19 15:08 ` Carsten Dominik
2007-07-19 16:14 ` Eddward DeVilla
2007-07-20 15:05 ` Adam Spiers
[not found] ` <931245f7aaa24436377e537552f1beab@science.uva.nl>
2007-09-01 11:01 ` Adam Spiers
2007-09-02 7:30 ` Carsten Dominik [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=c9e19e991f2d975f6dcf98852a77c6a8@science.uva.nl \
--to=dominik@science.uva.nl \
--cc=emacs-orgmode@gnu.org \
--cc=orgmode@adamspiers.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).