Skip to main content

Module vec_map

Module vec_map 

Source
Expand description

This module defines a associative map datastructure for spans data (meta, metrics, etc.) backed by a vector. Spans are mostly allocated and constructed, and more rarely read or mutated. VecMap is thus optimized for insertion (which is just Vec::push), without any hashing involved. Fetching and removing a value is, on the other hand, linear time in the size of the map. However, since meta and metrics are expected to be typically small (20ish elements or less), linear scan is usually still competitive with hashmap’s get.

Structs§

VecMap
A Vec-backed map that provides HashMap-like lookup by key.