indy-based string-switch proposal

Paul Sandoz paul.sandoz at oracle.com
Tue Nov 5 16:58:23 UTC 2019



> On Nov 4, 2019, at 3:09 PM, John Rose <john.r.rose at oracle.com> wrote:
> 
> On Nov 4, 2019, at 2:27 PM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
>> 
>> repeating structure using candy
> 
> Such as an apartment building canvassed by trick-or-treaters?
> (Boo, spell-check!)
> 

I am glad it afforded some light relief :-) it could have been worse: “… a marzipan increase in encoding confectionary …”.


> Condy can be good for factoring out repeats.
> But watch the per-condy overhead.
> 
> Sometimes there’s a good answer from cooking up a
> simple stringy DSL as with the string concatenation work.
> 

Yes, good point.

Paul.

> When I evaluate alternative encoding schemes I usually
> ask what is the expected number of constant pool indexes
> burned, for an average use case.  Sometimes class file
> size (in bytes) comes into it also, but CP slots are a uniquely
> limited resource, since the whole class file has to make
> do with 2^16-1 of them.
> 
> The important goal, IMO, is to make each constant
> in an indy/condy construct carry its weight, or else
> somehow maintain an expectation that the constant
> is probably already in use somewhere else in the
> class file.
> 
> — John
> 
> P.S. There are incremental ways to lift the 2^16-1 restriction,
> if we ever need to go there.  See notes on CONSTANT_Group
> in https://bugs.openjdk.java.net/browse/JDK-8161256 <https://bugs.openjdk.java.net/browse/JDK-8161256>
> 
> 



More information about the amber-dev mailing list