Draft language spec for JEP 355: Text Blocks

Alex Buckley alex.buckley at oracle.com
Tue May 21 19:45:40 UTC 2019


On 5/21/2019 5:51 AM, Brian Goetz wrote:
> As string literals get longer, the cost-benefit of interning get
> worse, and eventually turn negative; it is super-unlikely that two
> compilation units will use the same 14-line snippet of JSON (no
> benefit), and at the same time, we’re taking up much more space in
> the intern table (more cost).
>
> Surely today we’ll use Constant_String_info because that’s the
> sensible translation target, and if the same string appears twice in
> a single class, it’ll automatically get merged by the constant pool
> writer.  But committing forever to interning seems likely to be
> something we’ll eventually regret, without buying us very much.  Even
> the migration benefit seems questionable.

OK, I have walked back the requirement to intern text blocks in 3.10.6 
and 12.5. Spec updated in place 
(http://cr.openjdk.java.net/~abuckley/jep355/text-blocks-jls.html), old 
version available 
(http://cr.openjdk.java.net/~abuckley/jep355/text-blocks-jls-20190520.html).

Alex


More information about the amber-spec-experts mailing list