top | item 46750587

(no title)

NorwegianDude | 1 month ago

40 million reads per second, on a single core? 40 million reads/s is 25 ns per read, that is faster than any RAM I know of.

discuss

order

yencabulator|1 month ago

It's not like every read would make a separate trip all the way to RAM, caches are a thing and SIMD pipelines/parallelizes comparisons within a hash bucket quite well. Lookups from a hash map should amortize to something like 5-20ns per lookup these days. Abseil's Swiss Tables for C++ and Rust's Hashbrown both should reach that.

NorwegianDude|1 month ago

If you're looking up values from a 3 GB DB, most would have to hit RAM. Lookups form a hash map can be fast, but SQLite does quite a bit more than just a hash map lookup, and it would usually hit RAM, not L3 cache.