avioxtechnologies.com ↗Subscribe to the Dispatch

Research paperAVX-R-2026-01Front-end performance

Measure Before You Optimize: A Profiling-Led Approach to React Performance

Memoization, code splitting and server rendering all have costs. This study argues for profiling first — and maps each common bottleneck to the technique that actually addresses it.

By Aviox Blogs Engineering7 min read
A flame graph of stacked grey bars on near-black, with one bar in the middle of the stack highlighted in ember.
Aviox Research LibraryAVX-R-2026-01
On this page · 07 sections
  1. Abstract
  2. Key findings
  3. Introduction
  4. How React updates the interface
  5. Common classes of bottleneck
  6. Method: profiling
  7. Questions

Abstract

Performance work in React applications is frequently driven by intuition: components are wrapped in memo, values in useMemo and handlers in useCallback in the hope of fewer renders. Each of these techniques carries its own cost in memory, complexity and correctness risk. This paper proposes a profiling-led method. We summarize React’s render and commit model, describe how to capture and interpret profiles with the React DevTools Profiler and the Profiler API, and map the most common classes of bottleneck — unnecessary re-renders, oversized bundles, unstable list keys, broad context updates and inefficient loading — to the specific techniques that address them.

Key findings

  1. 01

    Profile first: optimization without measurement is effectively premature.

  2. 02

    Memoization helps only when props are stable and renders are expensive; elsewhere it adds cost.

  3. 03

    Stable, unique keys are a correctness requirement for lists, not merely a performance hint.

  4. 04

    Code splitting and server rendering address load time — a different problem from render time.

Introduction

Before optimizing a React application, we must understand how React updates the interface and how to measure an application’s performance. Optimization means reducing load time, minimizing memory use and keeping interactions responsive as an application grows in complexity and traffic. Done well, it improves user engagement, can reduce hosting costs, supports search ranking — page speed is a ranking factor — and often leaves code more modular and easier to maintain.

Done badly, it adds complexity in exactly the wrong places. The thesis of this paper is simple: measure first.

How React updates the interface

When state changes, React re-renders the affected components to produce a new element tree, compares it with the previous one, and applies only the differences to the DOM. Work therefore happens in two phases: a render phase, where components run and the new tree is computed, and a commit phase, where changes are written to the DOM.

Diagram: a state change triggers the render phase, where components re-run and the new tree is diffed against the previous one; the commit phase then applies only the changed nodes to the DOM.

Render is where components run; commit is where the DOM changes. Profilers measure both.

Common classes of bottleneck

Unnecessary re-renders
A state change high in the tree re-renders everything below it, including components whose output does not change.
Large component trees
Deeply nested trees are slow to render and update, and amplify every unnecessary re-render.
Inefficient data fetching
Waterfalls and over-fetching delay meaningful content and inflate load times.
Bloated bundles
Large JavaScript bundles take longer to download, parse and execute, delaying interactivity.
Memory leaks
Subscriptions and timers that outlive their components degrade performance until the app slows or crashes.
Improper state use
Setting state in loops or storing derived data multiplies renders without adding information.
Unoptimized images
Oversized images dominate transfer size and memory on many pages.

Method: profiling

Profiling measures where time is actually spent. The React DevTools browser extension includes a Profiler tab; Chrome DevTools’ Performance panel and Lighthouse complement it for load and runtime analysis.

Capturing a profile

  1. Open the React DevTools Profiler tab and press Record.
  2. Use the application as a person would — the profiler records every commit.
  3. Press Record again to stop and inspect the session.

The flame graph shows each commit as a tree whose bar widths represent render time; the ranked view sorts components by cost. Start with the widest bars and the components that render most often.

Measuring in code

For repeatable measurements — or to send timings to monitoring — wrap a subtree in the Profiler component. Its onRender callback fires after every commit of that subtree:

import { Profiler } from "react";

function onRender(id, phase, actualDuration, baseDuration) {
  // phase: "mount" | "update" | "nested-update"
  console.log(\`\${id} \${phase}: \${actualDuration.toFixed(1)}ms (base \${baseDuration.toFixed(1)}ms)\`);
}

export default function App() {
  return (
    <Profiler id="Dashboard" onRender={onRender}>
      <Dashboard />
    </Profiler>
  );
}

actualDuration is the time spent rendering this commit; baseDuration estimates the cost of rendering the whole subtree without memoization. A large gap between them shows memoization is working; a small one shows it is not helping.

From data to change

  1. Collect a profile of a realistic interaction.
  2. Analyze it for the components that take the most time or render most often.
  3. Prioritize the changes likely to have the largest effect.
  4. Optimize narrowly — one bottleneck at a time.
  5. Verify with a new profile, comparing against the original.
  6. Iterate until the interaction meets its budget.

Originally published at Aviox Blogs engineering handbook.

Written by

Aviox Blogs Engineering

Field notes, deployment guides and research from the engineers who build web, cloud and mobile products at Aviox Blogs.

Insights & Understanding

Frequently Asked Questions

Answers to common questions regarding this article's topic, architecture, and practical applications.

More from the library

Everything new
Two circular peers on a midnight-blue field joined by a fan of fine lines with one ember line through the centre, and a dotted arc rising to a diamond-shaped relay above.

Research

Peer-to-Peer by Design: How WebRTC Negotiates a Real-Time Connection

How two browsers that cannot see each other establish a direct, encrypted media channel: capture, signaling, SDP offer and answer, and ICE with STUN and TURN.

Aviox Blogs Engineering · 7 min read
Three groups of database cylinders on midnight blue — separate cylinders on each side, and one large ember cylinder in the middle shared by six tenants.

Research

One Application, Many Tenants: Three Multi-Tenancy Architectures in Laravel

Comparing three ways to serve many customers from one Laravel codebase — separate databases, a shared schema with tenant IDs, and packaged tenancy — on isolation, cost and effort.

Aviox Blogs Engineering · 5 min read

The Dispatch · Newsletter

Engineering notes, delivered occasionally.

New deep dives, research and what’s next in AI and software — one calm email when there’s something worth reading. Unsubscribe in one click.

sales@avioxtechnologies.comOne email when there’s something worth reading · Never sold or shared