Remove Primitive Optimization for Boolean Collections #2390
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR
list<boolean>
was optimized in this move to eclipse-collections, but its usage is almost non-existent (all instances appear to be some copy-paste from Excavator?). IMO, it's usage, or really this optimization, signals to devs that using a wire format oflist<boolean>
is a good idea, when a bit mask would be a much better abstraction for such a structure when it comes to our serialization.On the other hand, it feels like an odd omission given the shape of the feature. Net net, I think removing it lowers our ownership overhead of this.
boolean
is a weird primitive type and when tackling changes for the 4 primitive typesboolean
is always a little unique. For example:false
ortrue
.addAll
paths for primitive arrays theboolean
variant of the methods needed some different routines due toArrays.stream
not having aboolean
variant.After this PR
Treated like any old boxed type, in the long term we should consider a bit mask type for an efficient representation of the usage pattern.
Possible downsides?
This may regress the peak memory usage on the small use cases, but also let's consider leveraging more expressive external types to experiment.