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
I'm using Koloboke Compile to generate a ObjLongMap. I have a file containing 249_229_948 records and I'm using the default constructor with that number as the expected size. I've noticed that the capacity of the final map is substantially higher than the expected size: 498_958_307.
I've tried to play with the HashConfig already but, I wonder if there is a way allocate the exact capacity needed. In my case, the Map will be immutable once it's loaded into memory so, I don't need it to grow at any factor.
The text was updated successfully, but these errors were encountered:
Seems that you are using @QuadraticHashing. @QuadraticHashing chooses the capacity from a predefined subset of integers, so you couldn't obtain a map with arbitrary capacity, you could only try to obtain a capacity of +- 1% from the exact number that you want, by playing with HashConfig, or with the given expectedSize, using a fixed HashConfig and expectedSize, so that desiredCapacity = expectedSize / targetLoad.
Note that this algorithm is slower than @LinearProbing, which restricts available capacities to powers of two.
I'm using Koloboke Compile to generate a
ObjLongMap
. I have a file containing249_229_948
records and I'm using the default constructor with that number as the expected size. I've noticed that the capacity of the final map is substantially higher than the expected size:498_958_307
.I've tried to play with the
HashConfig
already but, I wonder if there is a way allocate the exact capacity needed. In my case, the Map will be immutable once it's loaded into memory so, I don't need it to grow at any factor.The text was updated successfully, but these errors were encountered: