Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
map.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace bb::avm2 {
6
7// Who would've guessed that std::unordered_map is slow?
8// https://news.ycombinator.com/item?id=36521291
9//
10// We use an alternative single-header implementation that is faster and more memory efficient.
11// https://github.com/martinus/unordered_dense
12// https://martin.ankerl.com/2019/04/01/hashmap-benchmarks-01-overview/
13// https://github.com/martinus/robin-hood-hashing is archived and recommends ankerl::unordered_dense.
14// In our benchmarks this map is at least 25% faster for insertion and 2x faster for visits.
15template <class Key, class T> using unordered_flat_map = ::ankerl::unordered_dense::map<Key, T>;
16// Note: if we eventually want to have lower memory usage at the cost of some speed,
17// we can use ::ankerl::unordered_dense::segmented_map instead.
18
19} // namespace bb::avm2
::ankerl::unordered_dense::map< Key, T > unordered_flat_map
Definition map.hpp:15