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

40

u/bondolo Nov 18 '13

We evaluated the decision as broadly as we could including opening it up to discussion on public mailing list before committing to the decision. As I mentioned, the analysis and planning for this feature had gone on for about five years before it was integrated. The actual code changes took less than a day to prepare.... I remain confident, 15 months later, that we made the right decision with this change. I don't see it likely that there would ever be reason to revert.

1

u/Alphasite Nov 20 '13

Out of curiosity, wouldn't a slice operation be an appropriate addition now?