Slight inconsistency between state of valhalla and the value objects draft JEP

John Rose john.r.rose at oracle.com
Fri Dec 24 22:31:36 UTC 2021


You can use sentinel values as well as tag bytes in some cases like Optional, which amounts to a fractional bit of overhead instead of one or eight bits. That should work for Optional and many other one-field types. 

None of these tactics are guaranteed by the JVMS. It’s to be expected that different docs will set slightly different expectations for optimizations as long as they agree on the required contracts. One should expect that the performance model will evolve over time (within a stable JVMS) even though we are saying now what we think what will be true. 

> On Dec 23, 2021, at 3:28 PM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> - if it's a sealed interface, you need several bits to store the index of the permitted subtypes
>  (in practice a byte but you may reuse the same byte as above (255 or 128 permitted subtypes seems a lot))


More information about the valhalla-dev mailing list