{"id":17331151,"url":"https://github.com/medmes/latency","last_synced_at":"2026-01-06T12:49:19.658Z","repository":{"id":78239745,"uuid":"260345126","full_name":"medmes/latency","owner":"medmes","description":"About latency numbers!","archived":false,"fork":false,"pushed_at":"2020-05-01T15:08:49.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T11:16:03.295Z","etag":null,"topics":["latency","performance","systems"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/medmes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-01T00:08:11.000Z","updated_at":"2020-07-10T08:15:43.000Z","dependencies_parsed_at":"2023-03-01T15:01:52.914Z","dependency_job_id":null,"html_url":"https://github.com/medmes/latency","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmes%2Flatency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmes%2Flatency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmes%2Flatency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medmes%2Flatency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medmes","download_url":"https://codeload.github.com/medmes/latency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791971,"owners_count":20672671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latency","performance","systems"],"created_at":"2024-10-15T14:53:37.736Z","updated_at":"2026-01-06T12:49:19.611Z","avatar_url":"https://github.com/medmes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# latency numbers\n\n### Latency numbers every programmer should know\n    L1 cache reference ......................... 0.5 ns\n    Branch mispredict ............................ 5 ns\n    L2 cache reference ........................... 7 ns\n    Mutex lock/unlock ........................... 25 ns\n    Main memory reference ...................... 100 ns             \n    Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs\n    Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs\n    SSD random read ........................ 150,000 ns  = 150 µs\n    Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs\n    Round trip within same datacenter ...... 500,000 ns  = 0.5 ms\n    Read 1 MB sequentially from SSD* ..... 1,000,000 ns  =   1 ms\n    Disk seek ........................... 10,000,000 ns  =  10 ms\n    Read 1 MB sequentially from disk .... 20,000,000 ns  =  20 ms\n    Send packet CA-\u003eNetherlands-\u003eCA .... 150,000,000 ns  = 150 ms\n\nAssuming ~1GB/sec SSD\n\n![Visual representation of latencies](http://i.imgur.com/k0t1e.png)\n\nVisual chart provided by [ayshen](https://gist.github.com/ayshen)\n\nData by [Jeff Dean](http://research.google.com/people/jeff/)\n\nOriginally by [Peter Norvig](http://norvig.com/21-days.html#answers)\n\n### Lets multiply all these durations by a billion:\n\nMagnitudes:\n\n### Minute:\n    L1 cache reference                  0.5 s         One heart beat (0.5 s)\n    Branch mispredict                   5 s           Yawn\n    L2 cache reference                  7 s           Long yawn\n    Mutex lock/unlock                   25 s          Making a coffee\n\n### Hour:\n    Main memory reference               100 s         Brushing your teeth\n    Compress 1K bytes with Zippy        50 min        One episode of a TV show (including ad breaks)\n\n### Day:\n    Send 2K bytes over 1 Gbps network   5.5 hr        From lunch to end of work day\n\n### Week\n    SSD random read                     1.7 days      A normal weekend\n    Read 1 MB sequentially from memory  2.9 days      A long weekend\n    Round trip within same datacenter   5.8 days      A medium vacation\n    Read 1 MB sequentially from SSD    11.6 days      Waiting for almost 2 weeks for a delivery\n\n### Year\n    Disk seek                           16.5 weeks    A semester in university\n    Read 1 MB sequentially from disk    7.8 months    Almost producing a new human being\n    The above 2 together                1 year\n\n### Decade\n    Send packet CA-\u003eNetherlands-\u003eCA     4.8 years     Average time it takes to complete a bachelor's degree\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedmes%2Flatency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedmes%2Flatency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedmes%2Flatency/lists"}