KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've seen several examples from different languages that unambiguously prove that joining elements of a list (array) is many times faster than just concatenating string. Why? What is the inner algorithm that works under both operations and why is the one faster than another? Here is a Python example of what I mean: # This is slow x = 'a' x += 'b' ... x += 'z' # This is fast x = ['a', 'b', ... 'z'] x = ''.join(x)
Tags (comma-separated)
Save Edits
Cancel