ALEXKRI.NET
Resume Contact
← Back

It's the memory latency, stupid

100% CPU doesn’t mean the CPU is working — it can mean it’s standing around waiting for DRAM. Nice walkthrough on a ClickBench GROUP BY over 99M rows with ~17M distinct keys: a naive hash map stalls on memory for 50.1% of its slots and reads ~4.5 GB from DRAM. Radix-partition into 4096 buckets so each table fits in cache and you retire ~70% more operations, yet the query drops from 3.6s to 2.7s. Doing more work to touch less memory is the trade.

Read the source ↗