From: Katsumi Yamaoka <yamaoka@jpl.org>
Subject: Re: how to turn this Gnus function into a macro?
Date: Thu, 08 Jan 2004 15:06:18 +0900 [thread overview]
Message-ID: <b9yr7yb0yat.fsf@jpl.org> (raw)
In-Reply-To: <b9ybrpf2jac.fsf@jpl.org>
>>>>> In <b9ybrpf2jac.fsf@jpl.org> Katsumi Yamaoka wrote:
> BTW, (eval '(MACRO ARG)) can be used, however it is four times
> slower than (MACRO ARG).
Here are benchmarks:
;; The function which Ted posted first.
;; <4noetfo10c.fsf@collins.bwh.harvard.edu>
(byte-compile 'spam-fetch-field-fast)
(benchmark 1000 (spam-fetch-field-fast 51549 'from))
0.001971006393432617
0.0019199848175048828
0.001867055892944336
0.0019189119338989258
0.0018950700759887695
;; The `eval' version.
(defun spam-fetch-field-fast-1 (article field)
(when (and (numberp article) (symbolp field))
(eval `(,(intern (concat "mail-header-" (symbol-name field)))
,(gnus-data-header (assoc article (gnus-data-list nil)))))))
(byte-compile 'spam-fetch-field-fast-1)
(benchmark 1000 (spam-fetch-field-fast-1 51549 'from))
0.006534099578857422
0.006331086158752441
0.006301999092102051
0.006219029426574707
0.006276965141296387
--
Katsumi Yamaoka <yamaoka@jpl.org>
next prev parent reply other threads:[~2004-01-08 6:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-07 22:19 Ted Zlatanov
2004-01-07 22:55 ` Jesper Harder
2004-01-08 0:09 ` Ted Zlatanov
2004-01-08 4:13 ` Jesper Harder
2004-01-08 2:13 ` Katsumi Yamaoka
2004-01-08 3:28 ` Ted Zlatanov
2004-01-08 3:33 ` Katsumi Yamaoka
2004-01-08 3:42 ` Jeremy Maitin-Shepard
2004-01-08 3:47 ` Katsumi Yamaoka
2004-01-08 4:06 ` Jeremy Maitin-Shepard
2004-01-08 6:06 ` Katsumi Yamaoka [this message]
2004-01-08 20:30 ` Ted Zlatanov
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9yr7yb0yat.fsf@jpl.org \
--to=yamaoka@jpl.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.
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 NNTP newsgroup(s).