3 ms·
For java it depends, it seems these days that not copying is a bigger performance issue than copying. So the recent openjdk builds have substring do a copy of t
by jerven 11y ago
For java it depends, it seems these days that not copying is a bigger performance issue than copying. So the recent openjdk builds have substring do a copy of the underlying char array. Which can change again. Other JVMs of course are free to do other things again, or mix and match depending on the circumstances.
edit: I believe String is overused in java land and we should have more CharSequence implementations. https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequ...