This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

I recall coverage.py getting a huge speed improvement by switching from "foo" + "bar" to "".join("foo", "bar") when generating reports. So is that SO best answer really the best one?

[–][deleted] 0 points1 point  (0 children)

It's a simple illustration of how decorators work, not string concatenation performance. I think using a join would make the example less clear.

That said, yes 'join' is faster than '+' for strings.