A single malloc took 7 milliseconds. So I deleted the slow path. (opens in new tab)
Every allocator benchmark leads with the median. malloc does 15M ops/sec, the typical call is 15 ns, ship it. The median never paged me at 3 a.m. The tail did. Same allocator, same workload, but measuring the worst single call instead of the typical one: Median: ~16 ns Worst case: 6,950,000 ns — almost 7 milliseconds. One malloc, occasionally, taking seven milliseconds. If you're rendering a frame in 16 ms or quoting a price in a market, that call just ate your entire budget — and the average...
Read the original article