Subject: bug#14776: 24.3.50; [PATCH] parse-time-string performance

From: Andreas Politz <[email-masked]>
Date: Thu, 04 Jul 2013 17:41:29 +0200

Glenn Morris <[email-masked]> writes:

> Glenn Morris wrote:
>
>> Why is it called 30+ times per article? Naively, seems like a chance for
>> a ~ 30x speed-up, compared to the ~ 4x one you seem to achieve.
>
> Oh, parse-time-string-chars, not parse-time-string. Ignore me.

Yes, but I just noticed something different.

In my benchmark the unpatched function runs for 41.5s on 100*3000 calls,
which comes down to an average of 0.415s per 3000 dates (or articles in
a summary buffer displaying parsed dates).  This should actually not be
very noticeable.

But it was. It took gnus ~40s to display this amount of articles and
most of it was spend in parse-time-string.  After tweaking it (i.e. the
patch) it came down to ~10s.  Now, looking more closely at the above,
non-gnus numbers, this makes no sense. (Though it's appealing to jump to
a conclusion, because it appears to be the correct factor.)

I should have tested this with -Q.  The reason is a customized
gc-cons-percentage (0.2) and gc-cons-threshold (67108864).  Using the
default values shows almost no difference anymore in gnus, i.e. both
versions (stock and patched) need around ~10s.

I suppose there are various lessons to learn from this endeavour.

-ap