News for hackers. Stuff that matters.
Re:Performance Improvement with the StringBuilder for C++ by jonhohle on Friday September 06, 2013 @12:57PM (#6341377)
> Not quite exactly the same issue, not sure about all JVMs but the HotSpot JIT will replace concatenation with StringBuilder usage in many cases but it may not be ideal.

It's not even the JIT, it's a static transformation at byte code creation time. Last I checked:

    String s = "foo" + "bar";
Produced identical byte code to:

    String s = new StringBuilder()
        .append("foo")
        .append("bar")
        .toString();

There are no comments on this comment yet.