Skip to main content

Where the Bottleneck Is

How to investigate slowness without optimizing everything and without calling every issue a generic performance problem.

Andrews Ribeiro

Andrews Ribeiro

Founder & Engineer

The problem

When a system gets slow, many teams switch into productive panic.

Everyone wants to help.

Then the parallel fixes start:

  • someone changes the query
  • someone memoizes the component tree
  • someone shrinks the payload
  • someone swaps a library

At the end, the system is still slow and nobody can clearly say what helped.

The base mistake is simple:

  • treating slowness like a problem spread evenly across the system when there is usually one dominant point holding the clock

Mental model

Think about it like this:

a bottleneck is the step that holds the clock the most.

It does not matter that the system has five imperfect parts.

If one of them concentrates most of the delay the user feels, that is where the investigation should start.

That bottleneck can live in very different places:

  • network
  • database
  • CPU
  • rendering
  • a third-party dependency
  • a queue or async worker

If you do not isolate that point with evidence, you are mostly spreading effort around.

Breaking it down

First: which flow is actually slow?

“The application is slow” is too vague.

You need a better cut:

  • opening the dashboard?
  • fetching users?
  • saving a form?
  • switching tabs?

Without that cut, you measure a lot of noise together.

Then: where is the time going?

Once the flow is clear, the investigation gets much better when you split it into stages.

Useful questions:

  • is the delay coming from waiting for data?
  • is the client spending time processing that data?
  • is the UI taking too long to update?
  • is the database query dominating the total?
  • is an external service holding the response?

That kind of separation is worth much more than optimizing “performance” as if it were one thing.

The symptom does not always point to the cause

A freezing screen can look like a frontend problem.

But maybe the browser is just waiting for a slow API.

A slow response can look like a database issue.

But maybe the server is burning CPU serializing far too much data.

That is why experienced engineers do not diagnose only from the symptom.

The symptom shows where it hurts.

The bottleneck shows where the time is actually being burned.

The biggest cost deserves the first move

Even when several things are not ideal, the practical question is:

  • which one is holding the most time right now?

If the API takes 1.8s and rendering takes 120ms, starting with DOM tuning is a weak bet.

That does not mean the 120ms does not exist.

It means it is not the first bill you should pay.

Tools matter less than the answer

You might use a profiler, tracing, logs, metrics, EXPLAIN, browser DevTools, or something else.

The point is not to name the fanciest tool.

The point is to answer:

  • where the time is
  • how much time is there
  • what changed after the fix

Simple example

Imagine a dashboard that takes 2 seconds to open.

The frontend team suspects the chart because it looks heavy.

When someone measures it properly, they find:

  • API: 1.9s
  • client-side transformation: 40ms
  • chart render: 60ms

In that case, discussing a charting library migration is mostly a distraction.

The bottleneck is the data arriving late, not the UI drawing it.

Now imagine the opposite:

  • API: 120ms
  • client-side transformation: 900ms
  • render: 700ms

Now the problem lives in the client.

Same user complaint.

Completely different diagnosis.

Common mistakes

  • trying to optimize several layers at the same time
  • calling every slow experience a frontend problem
  • ignoring the dominant step because another part looks more elegant to refactor
  • trusting intuition after measurement already pointed somewhere else
  • declaring the bottleneck too early without splitting the flow

How a senior thinks

More experienced engineers usually slow the room down before they speed it up.

The reasoning sounds more like this:

Before we optimize, I want to break the flow into stages and find which part is dominating the time. Without that, the chance of attacking the wrong place is too high.

Seniority shows up here in two things:

  • method of investigation
  • discipline to avoid buying a refactor before the evidence exists

It is not about having the best first guess.

It is about missing the target less often.

What the interviewer wants to see

In interviews, this topic tests more than performance knowledge.

It tests how clearly you think.

The interviewer wants to see whether you:

  • narrow the problem well
  • separate symptom from cause
  • measure before proposing a fix
  • prioritize the dominant step

A strong answer often sounds like this:

First I narrow the flow that is slow. Then I split the stages to find out whether the time is in network, backend, database, CPU, or rendering. Once I find the dominant cost, I attack that point before spreading optimization across the rest of the system.

Finding the real bottleneck is more valuable than producing ten elegant suspicions.

Performance work gets better when the team stops optimizing the whole system and starts following the right clock.

Quick summary

What to keep in your head

Practice checklist

Use this when you answer

You finished this article

Next article How to Optimize LCP Without Guessing What Is Slow Previous article Avoiding Overengineering

Keep exploring

Related articles