From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Andreas Politz <politza@hochschule-trier.de>
Cc: 14776@debbugs.gnu.org
Subject: bug#14776: 24.3.50; [PATCH] parse-time-string performance
Date: Thu, 04 Jul 2013 23:15:11 +0200 [thread overview]
Message-ID: <m3bo6iqb6o.fsf@stories.gnus.org> (raw)
In-Reply-To: <87ppuyhw32.fsf@hochschule-trier.de> (Andreas Politz's message of "Thu, 04 Jul 2013 23:08:33 +0200")
Andreas Politz <politza@hochschule-trier.de> writes:
>> (benchmark-elapse (dotimes (i 10000) (parse-time-string "Thu, 04 Jul
>> 2013 20:06:00 +0200")))
>> => 1.120856647
>
> => 0.215108395
> ;-O
Wow, that's a pretty impressive speed-up. I do see one issue, though --
it doesn't parse 2-digit years? That's a requirement.
Anyway, with this large speed-up, I think we should definitely consider
swapping out the current parse-time code with your code. Could you
collect a bunch of Date headers from the wild and see whether the old
and new versions agree on them all?
> It looks that way, i.e. parse-time-string is pretty simple compared to
> that. But most Date header I've seen popping up in my mail seem to
> adhere to a strict rfc2822 format anyway, except for the occasional
> non-strict timezone.
Yes, mailers have gotten a lot better about adhering to the RFC2822 date
format the last decade.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
next prev parent reply other threads:[~2013-07-04 21:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 1:21 bug#14776: 24.3.50; [PATCH] parse-time-string performance Andreas Politz
2013-07-03 1:27 ` Andreas Politz
2013-07-03 3:32 ` Glenn Morris
2013-07-03 3:34 ` Glenn Morris
2013-07-04 15:41 ` Andreas Politz
2013-07-04 18:41 ` Lars Magne Ingebrigtsen
2013-07-04 19:47 ` Andreas Politz
2013-07-04 20:31 ` Lars Magne Ingebrigtsen
2013-07-04 21:08 ` Andreas Politz
2013-07-04 21:15 ` Lars Magne Ingebrigtsen [this message]
[not found] ` <87hagaeztj.fsf@hochschule-trier.de>
2013-07-06 15:34 ` Lars Ingebrigtsen
2013-07-06 15:50 ` Andreas Politz
2013-07-06 15:56 ` Lars Ingebrigtsen
2013-07-06 16:07 ` Andreas Politz
2013-07-06 17:47 ` Andreas Politz
2013-07-08 14:51 ` Lars Magne Ingebrigtsen
2016-03-01 1:05 ` Lars Ingebrigtsen
2019-06-27 11:12 ` Lars Ingebrigtsen
2013-07-04 22:21 ` Andreas Politz
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3bo6iqb6o.fsf@stories.gnus.org \
--to=larsi@gnus.org \
--cc=14776@debbugs.gnu.org \
--cc=politza@hochschule-trier.de \
/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.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).