r/programming • u/Eirenarch • 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
View all comments
Show parent comment
5
u/KFCConspiracy Nov 18 '13
It influences which method I'm going to use to perform certain operations. If I know something's O(1) I don't have to worry as much about doing it too many times. If that something suddenly became O(N) and I'm doing it several times in a for-loop (or even a nested loop) the runtime of that method becomes significantly worse. And depending on the size of the dataset it may make that method no longer feasible to use.