From: Matthew Kerwin Date: 2012-06-21T11:42:21+09:00 Subject: Re: Benchmark obsession? I'll add to the string interpolation issue with an anecdote: I've had real world examples (in projects about which I'm forbidden to talk for legal reasons) where a refactoring from: foo = "a" + b + "c" type string assembly to: foo = ""; foo << "a" << b << "c" caused an immense speedup (we're talking tens of minutes here), reduced the memory footprint dramatically, and generally made our lives on the floor that little bit easier. Of course for something like my abc example above I'd definitely use "a#{b}c" because it's more readable (as well as everything else); but with large document generation sometimes interpolation is just not feasible. Ryan mentioned Java; the concatenation optimisation is exactly analogous to a previous time in the same company I achieved a very similar improvement by converting Java Strings to StringBuilders. It's still not interpolation, but it can have a genuine, measurable effect. Knowing that + creates all those new instances while << doesn't can be useful and practical knowledge. Caveat: I'm pretty damned sure Ruby was not the right language to be using on that project. One makes do with what one is given. --   Matthew Kerwin, B.Sc (CompSci) (Hons)   http://matthew.kerwin.net.au/   ABN: 59-013-727-651   "You'll never find a programming language that frees   you from the burden of clarifying your ideas." - xkcd