DEV Community

Cover image for A 100ms API Can Still Produce a Terrible User Experience
Hakeem Abbas
Hakeem Abbas

Posted on

A 100ms API Can Still Produce a Terrible User Experience

Your backend team tells you the API is fast. The endpoint responds in 100ms. Database queries are optimized. Server CPU looks healthy. P95 latency is under 200ms.
So why does the application still feel slow? Because the user doesn't experience your API latency. They experience the time between doing something and seeing the result. Those are very different measurements.
Imagine a user clicks “Load Dashboard.” The API takes 100ms to respond, but the browser has to establish connections, download resources, execute JavaScript, hydrate the application, make another request, process the response, and finally render the UI. The user might wait 600ms before anything meaningful appears. Your API is still 100ms. The experience isn't.

The Request Doesn't Start at Your Server

A simplified request might look like this:
DNS

TCP

TLS

Request

Server

Database

Serialization

Network

Browser

JavaScript

Rendering
When engineers talk about API performance, they're usually measuring only one section:
Request → Server → Database → Response
That's useful. But it's not the complete interaction. Even before your server sees the request, there can be DNS resolution, connection setup, TLS negotiation, and network latency. And after the server responds, the work isn't finished.
The browser still has to receive the response, parse it, execute JavaScript, update application state, calculate layout, and paint pixels. That's what the user actually experiences.

A 100ms API Can Become a 600ms Interaction

Consider a simple example. A user clicks a button and the application performs two sequential requests:
Click

Request A — 100ms

Request B — 120ms

Browser processing — 100ms

Rendering — 80ms
The backend APIs are both fast. But because Request B cannot start until Request A finishes, the user has already spent 220ms waiting on the network.
Add browser work, connection overhead, JavaScript execution, and rendering, and the interaction can easily move toward 500–600ms or more. Nothing is individually terrible. The sequence is the problem. This is why optimizing a single endpoint doesn't necessarily make an application feel faster.

Waterfalls Are Often the Real Problem

One of the first things I'd look for when debugging a slow interaction is a request waterfall. For example:
Page
└── User API
└── Account API
└── Orders API
└── Recommendations API
If every request depends on the previous one, latency accumulates. Even if each endpoint takes only 100ms, four sequential requests already introduce roughly 400ms of server-side waiting before accounting for network and browser overhead.
If the requests are independent, they might instead run concurrently:
┌── User API
Page ────────┼── Account API
├── Orders API
└── Recommendations API
Now the total time is closer to the slowest request rather than the sum of all requests. That's an architectural optimization, not an API optimization.

The Browser Has Its Own Performance Budget

Another mistake is assuming that once the API response arrives, the UI can immediately update. Modern web applications can have significant client-side work. The browser may need to:

  • Parse HTML and JavaScript
  • Execute application code
  • Hydrate server-rendered components
  • Parse large JSON responses
  • Update application state
  • Recalculate layout
  • Paint the updated interface Consider a page that receives a 500KB JSON response but only needs ten fields to display the initial view. The API might return that data in 100ms. The backend is happy. The browser still has to process everything. That's why response size, JavaScript execution, hydration, and rendering can matter just as much as server latency.

Perceived Performance Is Also About What Happens First

There's another subtle part of performance: users don't necessarily care about the total time if useful feedback appears quickly. Compare two applications.
Application A:
Click
→ 600ms nothing
→ Complete UI appears
Application B:
Click
→ 100ms loading state
→ 250ms partial content
→ 500ms complete UI
Both might take roughly the same amount of time to reach completion. Application B usually feels much faster because the interface responds immediately and communicates progress. That means performance work isn't always about reducing the final number. It's also about reducing time to first meaningful feedback.

Measure the Whole Journey

This is why I wouldn't evaluate application performance using API latency alone. I'd want to understand the complete path:
User Action

Browser Event

Network

Server

Database

Response

JavaScript

State Update

Layout

Paint

User Sees Result

Each stage can introduce latency. And importantly, the bottleneck can move. You might spend a week reducing an API from 150ms to 80ms and discover that the browser spends 300ms processing the response. You just optimized the wrong part of the system.
For web applications, I'd use browser performance tooling alongside backend metrics. A server trace can tell you what happened inside your infrastructure. A browser performance trace tells you what happened to the user. You need both.

Optimize the Interaction, Not Just the Endpoint

A fast API is valuable. But it's only one component of application performance. If an interaction feels slow, don't immediately open the backend profiler and start optimizing SQL queries. First ask:

  • Where is the user actually spending time?
  • Is there a network waterfall?
  • Are requests unnecessarily sequential?
  • Is the payload too large?
  • Is JavaScript blocking the main thread?
  • Is hydration expensive?
  • Is the browser doing excessive layout work?
  • Is the UI waiting for data that could have been rendered earlier? The fastest API in the world can't compensate for a slow sequence of everything around it. That's the distinction I keep coming back to: Server latency measures your backend. End-to-end latency measures the experience. And ultimately, users don't care that your API took 100ms. They care about how long it took from “I clicked” to “I can see and use the result.” API performance is application performance only when the rest of the application isn't the bottleneck.

Top comments (1)

Collapse
 
alexshev profile image
Alex Shev

The actionable metric here is interaction-level span time with a breakdown by critical-path stage. That makes the next optimization obvious: if the slowest segment is a dependent fetch, change the graph; if it is hydration, reduce or defer client work. Endpoint p95 alone cannot make that distinction.