Latency: From Nanoseconds to Seconds

4.Latency: From Nanoseconds to Seconds

M

In this chapter

We'll put real, honest numbers on the memory hierarchy's own tiers — from RAM's ~100 nanoseconds to a network round-trip's ~100 milliseconds or more — and use them to explain, precisely, why GreenMart's page genuinely feels slow.

8–10 min

The Problem in Real Life

Sarah pulls up the page-load ticket. "Page load: slow" doesn't say slow compared to what, or why — just that it's real, and customers are noticing.

"Let's actually put numbers on this," Sarah says, "because 'slow' means something very different depending on which tier of the hierarchy a request has to touch."

S

Every one of these storage tiers has a real, honest number attached to it. Let's use them.

Sarah

"Slow" as a Feeling vs. Latency as a Real Number

Latency is a real number, not a feeling

"Slow" becomes diagnosable the moment it's tied to a specific tier's specific, honest latency figure.

Each tier is often 100-1000x slower than the one above it

The gap between RAM and disk, or disk and network, isn't small — it's routinely one to three orders of magnitude.

Latency: From Nanoseconds to Seconds

Latency is the real, measurable time between asking for data and getting an answer back. It's a genuinely different question from how much data fits (capacity) or how much data moves per second (throughput, two chapters ahead) — a storage tier can have huge capacity and still be painfully slow to reach, and that gap is exactly what latency measures.

  • The numbers span an enormous range. RAM access takes roughly 100 nanoseconds. An SSD takes roughly 100 microseconds — a thousand times slower than RAM. A spinning hard disk takes roughly 10 milliseconds — a hundred times slower again. A request over a real network can take 100 milliseconds or more, depending on distance. Each tier down the memory hierarchy isn't a little slower than the one above it — it's routinely one to three orders of magnitude slower.
  • Making that gap human-sized. If a single RAM access (100 nanoseconds) were stretched out to feel like one second, an SSD access at that same stretched scale would feel like about 15 minutes, and a real network round-trip could feel like multiple days. That's not an exaggeration for effect — it's the honest, scaled-up shape of the real gap between tiers.
  • Why GreenMart's page genuinely feels slow. A page load that has to reach all the way to a slow tier — a cold database query hitting disk, or a network call to a far-away service — pays that tier's real latency cost, every single time, unless something faster sits in front of it. "Page load: slow" isn't vague anymore: it's a real request paying a real, specific latency cost, at a specific tier, and now that's a diagnosable, fixable fact instead of a feeling.
Table — Real Latency, Scaled to Human Time
Storage TierReal Latency (approximate)If RAM Felt Like 1 Second, This Tier Would Feel Like
RAM~100 nanoseconds1 second (the baseline)
SSD~100 microseconds~17 minutes
Hard disk (spinning)~10 milliseconds~28 hours
Network round-trip~100 milliseconds or more~11 days or more

These are honest, real order-of-magnitude figures for typical hardware, not exact numbers for any one specific device — the point isn't the precise figure, it's the sheer size of the real gap between tiers.

This is exactly why caching (Act 4) and every other technique this course covers exist at all: not to make persistent storage itself faster, but to avoid paying its real latency cost more often than genuinely necessary.

Key Takeaway

Latency isn't a vague feeling of slowness — it's a real, specific number attached to a real, specific storage tier, and knowing which tier a slow request actually touched is the difference between guessing at a fix and diagnosing one.

Why This Matters

"It feels slow" is not a diagnosis GreenMart can act on. "This request pays network latency it doesn't need to" is — and that precision is exactly what understanding real latency numbers, tier by tier, makes possible.

GreenMart now has real, honest numbers behind every tier of the memory hierarchy — the actual reason "slow" happens, not just a feeling about it. The next chapter turns to a genuinely different question: not how fast a single request is, but how much data can actually fit.

Next