This class implements mutable maps with Long keys based on a hash table with open addressing.
Basic map operations on single entries, including contains
and get
, are
typically substantially faster with LongMap
than HashMap. Methods that act
on the whole map, including foreach
and map
are not in general expected
to be faster than with a generic map, save for those that take particular
advantage of the internal structure of the map: foreachKey
,
foreachValue
, mapValuesNow
, and transformValues
.
Maps with open addressing may become less efficient at lookup after repeated
addition/removal of elements. Although LongMap
makes a decent attempt to
remain efficient regardless, calling repack
on a map that will no longer
have elements removed but will be used heavily may save both time and
storage space.
This map is not intended to contain more than 2^29 entries (approximately 500 million). The maximum capacity is 2^30, but performance will degrade rapidly as 2^30 is approached.
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any