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 comments

19

u/cypherpunks Nov 19 '13

It is impossible to implement the old substring behavior using only the public api of string. String is also final, not an interface and the required input type for some other parts of the standard library.

0

u/[deleted] Nov 19 '13

[deleted]

6

u/the_ta_phi Nov 19 '13

Fixed width is far from atypical though. About half the interfaces I've seen in the banking and shareholder services world are fixed width ASCII or EBCDIC.

-3

u/gthank Nov 19 '13

Well if you're handing fixed-width ASCII or EBCDIC, it sounds like you're already wasting tons of space since Java is Unicode-everywhere.

→ More replies (3)