PATCH: Speed up direct string concatenation by 20+%!

Larry Hastings larry at hastings.org
Fri Sep 29 17:54:15 CEST 2006


Fredrik Lundh wrote:
> > Sure.  Here are the results, but with range (10000000):
> ten million?  what hardware are you running this on?

Athlon 64 x2 4400+ (aka 2.2GHz), 3GB of RAM, Windows XP.


> what's in "s" when that loop is done?

It's equivalent to " 'a' * 10000000 ".  (I shan't post it here.)


Also, I misspoke earlier; it's not an improvement of 697%, but of 597%.
To be precise, it takes about 1/7 the time of the original.

Cheers,


/larry/




More information about the Python-list mailing list