Latency Numbers Every Programmer Should Know
gist.github.com
gist.github.com
It shows you by series of questions, how fast code run, what is speed of ram vs cache, ram vs hdd, file vs sql read.
Highly recommended.
Note that it also assumes low network latency, though; if you have congestion within the data center, things change.
OTOH you won't always have sequential access so services that store data in memory cover some of those other cases (eg a KV store like Redis).
Edit: Also, in 10,000 ns, light travels about 3 km in a vacuum. I know latency is addressed a bit in there, but our closest DC is about 70 km away from our main office. That's a pretty substantial hit on latency, especially considering our servers still have spinning discs in them.
How outdated are some of these numbers?
According to this[1] source (linked in the gist comments), ping is down to 144ms from LA to Amsterdam.
Thanks for clarifying.
The datacenter round-trip and sequential reading from memory sometimes change places now, and sending 1MB on some networks is on the same ballpark of reading 1MB from memory. (There has been some articles about this change here on HN.)
https://people.eecs.berkeley.edu/~rcs/research/interactive_l...
(Use the slider)
It shows disk seek and and sequential SSD read going down a lot. However, it also extrapolates out to 2020.
The code listing does have a lot of sources, and shows the extrapolation done, which I didn't look into in great detail.
These numbers are also important when writing software that runs on consumer PCs where real-time performance is a feature (e.g. most PC games).
Main memory reference - 100ns
Compress 1K bytes with Zippy - 3,000ns
So it takes 30 main memory accesses to zip up 1K? Not likely.