DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Ingesting Public Data That Fails Silently: Patterns From a TypeScript and Cloudflare Workers Pipeline
  • Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures
  • Designing a Polling Pipeline for Rate-Limited APIs Without Losing Data
  • Decoupling a Data Pipeline From the Tables It Was Never Supposed to Depend On

Trending

  • Top Gen AI Frameworks for Go in 2026: A Hands-On Comparison
  • Building a Windows App for a Resilient SSH SOCKS Proxy and Selective Browser Routing
  • Persisting Cookies Across JAX-WS Service Calls Using a Custom SOAP Handler
  • Java Virtual Threads Under Load: Three Production Limits

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Data
  4. Latency Numbers Everyone Should Know

Latency Numbers Everyone Should Know

A handy reference post on latencies from cache to continent hoping. One to save to the bookmarks!

By 
Deepak Karanth
·
Mar. 15, 16 · Analysis
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
25.9K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In a computer network, latency is defined as the amount of time it takes for a packet of data to get from one designated point to another.

In more general terms, it is the amount of time between the cause and the observation of the effect.

As you would expect, latency is important, very important. As programmers, we all know reading from disk takes longer than reading from memory or the fact that L1 cache is faster than the L2 cache.

But do you know the orders of magnitude by which these aspects are faster/slower compared to others?

Latency for Common Operations

Jeff Dean from Google studied exactly that and came up with figures for latency in various situations.

With improving hardware, the latency at the higher ends of the spectrum is reducing, but not enough to ignore them completely! For instance, to read 1MB sequentially from disk might have taken 20,000,000 ns a decade earlier and with the advent of SSDs may probably take 100,000 ns today. But it is never going to surpass reading directly from memory.

The table below presents the latency for the most common operations on commodity hardware. These data are only approximations and will vary with the hardware and the execution environment of your code. However, they do serve their primary purpose, which is to enable us to make informed technical decisions to reduce latency.

For better comprehension of  the multi-fold increase in latency, scaled figures in relation to L2 cache are also provided by assuming that the L1 cache reference is 1 sec.

OperationNoteLatencyScaled Latency
L1 cache referenceLevel-1 cache, usually built onto the microprocessor chip itself.0.5 nsConsider L1 cache reference duration is 1 sec
Branch mispredictDuring the execution of a program, CPU predicts the next set of instructions. Branch misprediction is when it makes the wrong prediction. Hence, the previous prediction has to be erased and new one calculated and placed on the execution stack.5 ns10 s
L2 cache referenceLevel-2 cache is memory built on a separate chip.7 ns14 s
Mutex lock/unlockSimple synchronization method used to ensure exclusive access to resources shared between many threads.25 ns50 s
Main memory referenceTime to reference main memory i.e. RAM.100 ns3m 20s
Compress 1K bytes with SnappySnappy is a fast data compression and decompression library written in C++ by Google and used in many Google projects like BigTable, MapReduce and other open source projects.3,000 ns1h 40 m
Send 1K bytes over 1 Gbps network
10,000 ns5h 33m 20s
Read 1 MB sequentially from memoryRead from RAM.250,000 ns5d 18h 53m 20s
Round trip within same datacenterWe can assume that the DNS lookup will be much faster within a data center than it is to go over an external router.500,000 ns11d 13h 46m 40s
Read 1 MB sequentially from SSD diskAssumes SSD disk. SSD boasts random data access times of 100000 ns or less.100,000 ns23d 3h 33m 20s
Disk seekDisk seek is the method to get to the sector and head in the disk where the required data exists.10,000,000 ns231d 11h 33m 20s
Read 1 MB sequentially from diskAssumes regular disk, not SSD. Check the difference in comparison to SSD!20,000,000 ns462d 23h 6m 40s
Send packet CA->Netherlands->CARound trip for packet data from U.S.A to Europe and back.150,000,000 ns3472d 5h 20m
Data (computing)

Published at DZone with permission of Deepak Karanth. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Ingesting Public Data That Fails Silently: Patterns From a TypeScript and Cloudflare Workers Pipeline
  • Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures
  • Designing a Polling Pipeline for Rate-Limited APIs Without Losing Data
  • Decoupling a Data Pipeline From the Tables It Was Never Supposed to Depend On

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook