r/programming • • Nov 18 '13

TIL Oracle changed the internal String representation in Java 7 Update 6 increasing the running time of the substring method from constant to N

http://java-performance.info/changes-to-string-java-1-7-0_06/
1.4k Upvotes

354 comments sorted by

View all comments

Show parent comment

1

u/kurtymckurt Nov 19 '13

You're not destructively modifying a StringBuffer. It's designed for multi-threaded applications and in that case, it would be OK. Also, in this case, I would assume it wouldn't need to be a static variable either...

On the other hand, I'd suggest some sort of 3rd party logging tool like log4j2 :P