JEP 254: Compact Strings - length limits

Xueming Shen xueming.shen at
Tue Sep 6 21:56:14 UTC 2016

On 9/6/16, 2:18 PM, Tim Ellison wrote:
>> Do we have a real use case that impacted by this change?
> People stash all sorts of things in (immutable) Strings. Reducing the
> limits in JDK9 seems like a regression.  Was there any consideration to
> using the older Java 8 StringCoding APIs for UTF-16 strings (already
> highly perf tuned) and adding additional methods for compact strings
> rather than rewriting everything as byte[]'s?

Hi Tim,

I'm sorry I don't get the idea of "using StringCoding APIs for UTF-16 
can you explain a little more in detail? We did try various approaches, 
byte[] +
flag, byte[] + coder, coder, char[] + coder, etc) the current one 
appears to be
the best so far based on our measurement.


More information about the core-libs-dev mailing list