Author collinwinter
Recipients collinwinter, jyasskin
Date 2009-02-14.00:13:05
SpamBayes Score 1.87661e-08
Marked as misclassified No
Message-id <>
Updated the patch to use only PyString_CheckExact(); added a test for
the behaviour of string subclasses wrt the % operator.

There's a very slight performance hit when using % with numbers, but
it's so small as to be statistically insignificant. If it turns out to
be relevant in the future, it's easy enough to add a special case for

For some reason, using PyString_CheckExact instead of
PyString_CheckExact || PyString_Check actually results in slower code
(still an improvement, but not as much). The weird thing is that none of
the benchmarks I'm running use % on string subclasses at any point. I
talked about it with some of the gcc guys, but they didn't have any
immediate leads. I'm going to send them the .o files in case gcc is
missing some optimization.

New benchmark numbers:
Min: 0.687 -> 0.668: 2.96% faster
Avg: 0.689 -> 0.669: 2.96% faster

Min: 20.376 -> 20.187: 0.94% faster
Avg: 20.396 -> 20.225: 0.84% faster

Min: 0.560 -> 0.549: 1.94% faster
Avg: 0.562 -> 0.552: 1.93% faster

Min: 0.920 -> 0.905: 1.62% faster
Avg: 0.926 -> 0.913: 1.38% faster
Date User Action Args
2009-02-14 00:13:08collinwintersetrecipients: + collinwinter, jyasskin
2009-02-14 00:13:08collinwintersetmessageid: <>
2009-02-14 00:13:07collinwinterlinkissue5176 messages
2009-02-14 00:13:06collinwintercreate