3 ms·
I used that operator in a tight loop before the compiler was smart enough to automatically convert the code to use a StringBuilder. Boy was that slow...
by freefal 8y ago
I used that operator in a tight loop before the compiler was smart enough to automatically convert the code to use a StringBuilder. Boy was that slow...
- rmetzler 8y agoI didn't touch much Java Code for ~ 10 years now. I remember reading about the string concatenation problem in the Effective Java book. Using a StringBuilder was the very first thing I usually tried when I needed to improve performance on some unfamiliar code. I didn't know the Java compiler converts this automatically now. Since which version is this? I suspect there might be still edge cases where it doesn't work.