[−][src]Crate halfbrown
Halfbrown is a hashmap implementation that provides high performance for both small and large maps by dymaically switching between different backend.
The basic idea is that hash maps are expensive to insert and lookup for small numbers of entries but effective for lager numbers.
So for smaller maps, we picked 32 entries as a rule of thumb, we simply store data in a list of tuples. Looking those up and iterating over them is still faster then hasing strings on every lookup.
Once we pass the 32 entires we transition the
backend to a HashMap
.
Note: Most of the documentation is taken from rusts hashmap.rs and should be considered under their copyright.
Macros
hashmap | Create a |
Structs
Drain | Drains the map |
HashMap |
|
IntoIter | Into iterator for a Halfbrown map |
Iter | Iterator over the key value pairs of a Halfbrown map |
IterMut | Mutable iterator over the key value pairs |
Keys | Iterator over the keys |
OccupiedEntry | A view into an occupied entry in a |
RawEntryBuilder | A builder for computing where in a |
RawEntryBuilderMut | A builder for computing where in a |
RawOccupiedEntryMut | A view into an occupied entry in a |
RawVacantEntryMut | A view into a vacant entry in a |
VacantEntry | A view into a vacant entry in a |
Values | Iterator over the values |
ValuesMut | Mutable iterator over the values |
Enums
Entry | A view into a single entry in a map, which may either be vacant or occupied. |
RawEntryMut | A view into a single entry in a map, which may either be vacant or occupied. |
Constants
VEC_LIMIT_UPPER | Maximum nymber of elements before the representaiton is swapped from
Vec to |
Type Definitions
DefaultHashBuilder | Default hasher for |