You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are using Trove library with some extra modifications where one of them is about null reference being used for the FREE value. The initial array creation and rehashing do not require to fill the array with FREE values (one extra iteration over the complete array is now required).
Additionally it can be cheaper for a garbage collector to see a null reference than many references to a singleton object representing FREE - null should be for free.
Obviously there is some cost in handling key slots where the new NULL object represents null key - could be reduced by noNull case (like you do with noRemoved).
The problem with NULL = new Object() (i. e. masking nulls) is that you should anyway do quite many annoying masking/unmasking to support custom equivalences. So it really makes sense only to have special implementation which throws NPE if the key is null and then just assumes all keys are not null. It should be returned if withNullKeyAllowed(false) is configured.
This is implemented in Koloboke Compile, it generates implementations that use null as the "free" value, if the implemented type is not annotated with @NullKeyAllowed.
Hi,
we are using Trove library with some extra modifications where one of them is about null reference being used for the FREE value. The initial array creation and rehashing do not require to fill the array with FREE values (one extra iteration over the complete array is now required).
Additionally it can be cheaper for a garbage collector to see a null reference than many references to a singleton object representing FREE - null should be for free.
Obviously there is some cost in handling key slots where the new NULL object represents null key - could be reduced by noNull case (like you do with noRemoved).
Michal
The text was updated successfully, but these errors were encountered: