Module vecmap

Source
Expand description

A map type implemented as a sorted list of key/value pairs.

For a small numbers of smallish elements, this is faster than other associative structures like BTreeMap and HashMap. Because of this, it is used as the collection type for symbol tables in the vm.

As a general benchmark, it was found that the break even point for a worst case scenario with String keys and 16-byte values (as the vm uses) was over 80 elements, vastly more than we expect to have in practice. Additionally, that was only for insertion; actual lookup time was around 2x faster (compared to BTreeMap as was used previously).

Structsยง

Entry
IntoIter
Iter
IterMut
VecMap
A map type implemented as a list of key/value pairs.