Billion-query-per-second lookup tables in C++
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
A new C++23 header-only library, perfect_hash, builds compile-time perfect hash maps for keys known in advance, such as HTTP methods or keywords. Using gperf-style association tables and 16-byte vector key comparison, it reports lookups around 1.2 to 2 ns on an Apple M3 Max, roughly 3 to 13 times faster…