Primitive boolean array packing

Aleksey Shipilev shade at
Sun Oct 7 08:01:47 UTC 2018

On 10/07/2018 12:05 AM, B. Blaser wrote:
> I didn't search much if such experiments have already been
> accomplished, but I'd like to take the temperature of this feature as
> completing the implementation represents a significant amount of work.
> Is this something that is worth exploring?

The most problematic part, in my mind, is that JMM requires the absence of word tearing for array
element accesses. See here:

With densely packed boolean[], you'd need to convert plain stores to locked/CAS-loops to support
this, I think, which raises all sorts of performance questions. Choosing between boolean[] and
BitSet is basically choosing between stricter/relaxed concurrency guarantees vs dense/sparse footprint.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the compiler-dev mailing list