loading...

Comment from a deleted article or podcast

Anything that is using symbol-by-symbol string concatenation would build a large number of strings instead of a single one that 'join' makes and would chew memory like crazy on large strings.

You might save a tiny portion of time on a single operation in a microbench, but gc kicking in sooner would destroy that benefit and will make matters worse.

The first variant here (split/reverse/join) is both the shortest, the most readable, and the less memory consuming one.