{"slug": "latency-numbers-every-programmer-should-know", "title": "Latency Numbers Every Programmer Should Know", "summary": "The article presents a table of approximate latency times for common computer operations, ranging from L1 cache references (0.5 ns) to transcontinental network round trips (150 ms). Compiled by Jeff Dean and originally by Peter Norvig, the data provides programmers with a reference for understanding the relative speed differences between CPU caches, main memory, SSDs, disks, and network communication.", "body_md": "latency.txt\n\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.\n      \nLearn more about bidirectional Unicode characters\n\n \n    Show hidden characters\n\nLatency Comparison Numbers (~2012)\n\n----------------------------------\n\nL1 cache reference                           0.5 ns\n\nBranch mispredict                            5   ns\n\nL2 cache reference                           7   ns                      14x L1 cache\n\nMutex lock/unlock                           25   ns\n\nMain memory reference                      100   ns                      20x L2 cache, 200x L1 cache\n\nCompress 1K bytes with Zippy             3,000   ns        3 us\n\nSend 1K bytes over 1 Gbps network       10,000   ns       10 us\n\nRead 4K randomly from SSD*             150,000   ns      150 us          ~1GB/sec SSD\n\nRead 1 MB sequentially from memory     250,000   ns      250 us\n\nRound trip within same datacenter      500,000   ns      500 us\n\nRead 1 MB sequentially from SSD*     1,000,000   ns    1,000 us    1 ms  ~1GB/sec SSD, 4X memory\n\nDisk seek                           10,000,000   ns   10,000 us   10 ms  20x datacenter roundtrip\n\nRead 1 MB sequentially from disk    20,000,000   ns   20,000 us   20 ms  80x memory, 20X SSD\n\nSend packet CA->Netherlands->CA    150,000,000   ns  150,000 us  150 ms\n\nNotes\n\n-----\n\n1 ns = 10^-9 seconds\n\n1 us = 10^-6 seconds = 1,000 ns\n\n1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns\n\nCredit\n\n------\n\nBy Jeff Dean:               http://research.google.com/people/jeff/\n\nOriginally by Peter Norvig: http://norvig.com/21-days.html#answers\n\nContributions\n\n-------------\n\n'Humanized' comparison:    https://gist.github.com/hellerbarde/2843375\n\nVisual comparison chart:   http://i.imgur.com/k0t1e.png\n\nInteractive Prezi version: https://prezi.com/pdkvgys-r0y6/latency-numbers-for-programmers-web-development/latency.txt", "url": "https://wpnews.pro/news/latency-numbers-every-programmer-should-know", "canonical_source": "https://gist.github.com/jboner/2841832", "published_at": "2012-05-31 08:15:11+00:00", "updated_at": "2026-05-22 18:08:30.265363+00:00", "lang": "en", "topics": ["developer-tools", "data", "hardware", "cloud-computing", "research"], "entities": ["Zippy", "SSD", "CA", "Netherlands"], "alternates": {"html": "https://wpnews.pro/news/latency-numbers-every-programmer-should-know", "markdown": "https://wpnews.pro/news/latency-numbers-every-programmer-should-know.md", "text": "https://wpnews.pro/news/latency-numbers-every-programmer-should-know.txt", "jsonld": "https://wpnews.pro/news/latency-numbers-every-programmer-should-know.jsonld"}}