Python speed-up

Alex Martelli aleaxit at
Wed Sep 22 21:57:01 CEST 2004

Gerrit <gerrit at> wrote:
> Why isn't cStringIO faster than concatenating strings?
> Using python2.4:

Python 2.4 did reduce the cost of the bigstring+=littlepiece trap.  But
I do agree there's nevertheless something strange here.  cStringIO is
using a very different strategy, a buffer that doubles and gets
realloc'd every time it would fill up -- maybe that's tripping up its


More information about the Python-list mailing list