rel:: [[Software Engineering]] rel:: [[Performance|performance]] # I/O Advancements Are Breaking Intuition on Performance ## Numbers Every Programmer Should Know 2010 [[Peter Norvig]] completed the ["answers"](http://norvig.com/21-days.html#answers) section to [Teach Yourself Programming in Ten Years](x-devonthink-item://CAD91E5B-8DF6-49F9-8BFB-E7F8D36F241C). ([according to web.archive.org](https://web.archive.org/web/20100619021128/http://norvig.com/21-days.html) sometime between June 11 and June 19, 2010). This set is also attributed to [Jeff Dean](http://research.google.com/people/jeff/), and makes the rounds with each new crop of engineers. Ov note, the absolute numbers themselves are accurate circa 2001. Focus on two entries. | | | | --------------------------------- | ------------------ | | read 1MB sequentially from memory | 250,000 nanosec | | read 1MB sequentially from disk | 20,000,000 nanosec | ## Intuition Bitrot The purpose of *Numbers Every Programmer Should Know* is not the numbers, but to build intuition for relative performance between mediums. But the relative numbers are changing and wrecking performance intuition for those of us who internalized them years ago. See ["Numbers Every Programmer Should Know" over time](https://colin-scott.github.io/personal_website/research/interactive_latency.html) [[Glauber Costa]] [points out that our API's and abstractions aren't keeping up with the storage medium advances](https://itnext.io/modern-storage-is-plenty-fast-it-is-the-apis-that-are-bad-6a68319fbc1a) ([archive link](x-devonthink-item://A72D46A1-559C-4E60-9D75-12F9F356AC4F)) And then there's Intel Optane drives and [PCIe 5.0](https://twitter.com/ryanshrout/status/1476609814402945029) blowing the doors off disks and SSDs. At `13GB/s` (!!) how would "The Numbers" look 20 years later? | | | speedup | | --------------------------------- | -------------- | ------- | | read 1MB sequentially from memory | 3,000 nanosec | 83x | | read 1MB sequentially from SSD | 77,000 nanosec | 260x | The speedup is impressive, but some mediums are improving faster than others, and this is breaking our intuitions for - in-memory databases - caching architecture - data locality - APIs