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 HashBrown hashmap.
Note: Most of the documentation is taken from rusts hashmap.rs and should be considered under their copyright.
Create a HashMap from a list of key-value pairs