Returns a wrapper that adheres to the java Map interface.
Returns a wrapper that adheres to the java Map interface. This wrapper helps to avoid unnecessary allocation of Option
array with the items
Overridden to get better performance.
Overridden to get better performance. See SmallHashMapEquals benchmark for a comparison with the default for various inputs.
Call the function f
for each tuple in the map without requiring a temporary object to be
created.
Overridden to get better performance.
Overridden to get better performance. See SmallHashMapHashCode benchmark for a comparison with the default for various inputs.
(Changed in version 2.8.0) keys
returns Iterable[A]
rather than Iterator[A]
.
Returns the number of keys that are not in the correct position based on their hash code.
Returns the average number of probes that are required for looking up keys in this map.
Returns the average number of probes that are required for looking up keys in this map. In general we want this number to be less than N/4. If we naively did a linear scan of the full data it would be N/2.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Constant time operation to get the number of pairs in the map.
Constant time operation to get the number of pairs in the map.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
(Changed in version 2.8.0) values
returns Iterable[B]
rather than Iterator[B]
.
(Since version ) see corresponding Javadoc for more information.
Simple immutable hash map implementation intended for use-cases where the number of entries is known to be small. This implementation is backed by a single array and uses open addressing with linear probing to resolve conflicts. The underlying array is created to exactly fit the data size so hash collisions tend to be around 50%, but have a fairly low number of probes to find the actual entry. With a cheap equals function for the keys lookups should be fast and there is low memory overhead.
You probably don't want to use this implementation if you expect more than around 50 keys in the map. If you have millions of small immutable maps, such as tag data associated with metrics, it may be a good fit.