Re:On Stack Overflow's recent battles with the .NET Garbage ...
by m_myers on Friday October 28, 2011 @12:37PM
(#3168962)
The JVM does rewrite individual concatenations as StringBuilders (so a+b+c+d results in one StringBuilder with three .append() operations), but the real performance problem is concatenating in a loop.
as opposed to
The JVM can't hoist the generated StringBuilder out of loops to produce the second, faster piece of code. I believe the CLR is the same.
[ Parent
| on HN ]
Re:On Stack Overflow's recent battles with the .NET Garbage ...
by njw45 on Friday October 28, 2011 @02:06PM
(#3169359)
Later JVMs do escape analysis, though - so there's not necessarily any difference between the two methods...