3 ms·
They should. It's a JVM feature on core JDK classes.
by daxfohl 1y ago
They should. It's a JVM feature on core JDK classes.
- taeric 1y agoThis implies they have their own String implementations? I wouldn't be shocked to find out that is the case, but it would surprise me.
- daxfohl 1y agoWhy? IIUC it implies that they _don't_ have their own string implementations. They get the benefit of Java JDK's string implementation (and JVM optimization thereof) for free. If they had their own string implementations, they'd be unable to use this optimization until it's publicly available.
- taeric 1y agoHa! My apologies, I misread that as "they shouldn't." Not sure why.
- xxs 1y agoJava strings enjoy heavy optimizations, including SSE4.2 and AVX intrinsics. Implementing your own byte[] wrappers (which Strings are) might be useful however it won't replace the built-in Strings. In short: a general purpose String substitute in Java would be an extremely poor idea.