String concatenation performance

Ben Sizer kylotan at
Thu May 11 17:32:03 CEST 2006

Cristian.Codorean wrote:
> I was just reading a "Python Speed/Performance Tips" article on the
> Python wiki
> and I got to the part that talks about string concatenation and that it
> is faster when using join instead of += because of strings being
> immutable.

The idea is that you call join() once rather than calling += many
times. You achieve this by placing all the strings you want
concatenating into a single list, not by calling join() with multiple

Ben Sizer

More information about the Python-list mailing list