Files
Mazdak Farrokhzad 8348151915 define SmallHashMap in spacetimedb_data_structures (#4136)
# Description of Changes

Defines `SmallHashMap` in `spacetimedb_data_structures`.
The data structure is a hybrid map that is backed by a vector and linear
scan for the first `M` elements.
Then it falls back into a normal hash map.
For the first `N` elements, where `N < M`, the vector is stored inline.
That is, the vector is a `SmallVec<[(K, V); N>`.
The structure is optimized for access patterns where the keys and values
are accessed together,
therefore, keys and values are not stored separately.

# API and ABI breaking changes

None, just additive.

# Expected complexity level and risk

1

# Testing

A comprehensive proptest suite is added for the datastructure.
2026-01-27 15:15:23 +00:00
..
2025-08-12 18:20:58 +00:00

⚠️ Internal Crate ⚠️

This crate is intended for internal use only. It is not stable and may change without notice.