3 ms·
Still quite a straightforward and elegant solution, but I'm curious what the performance is like these days compared to alternatives. The better the JIT gets, t
by morelisp 6y ago
Still quite a straightforward and elegant solution, but I'm curious what the performance is like these days compared to alternatives. The better the JIT gets, the more allocation (of the many intermediate strings, and the thrown-away string) would seem to matter.
- chrisrhoden 6y agoIf I remember right, the intermediate string version was already a reflection of the shifting interpreter landscape. I distinctly remember learning to always prefer Array#join for these kinds of things in 2006 or so for the same reason cited in the post. Of course, that could have been based on a misunderstanding on the part of the person talking with me, though I would guess it matters how many intermediates (or array elements) you're talking about. Sort of a miracle that you mostly don't need to worry about this stuff today, even running on a $100 mobile device.