f in x
> cd .. / HUB_EDITORIALE
Sviluppo di siti web

React Performance with memo lazy Suspense and Profiling — Speed Up Your App Without Rewriting Everything

[2026-06-23] Author: Ing. Calogero Bono

The client who commissioned your e-commerce cart is now writing: “The app freezes when loading the catalog with 500 products.” You open the profiler and see a component tree re-rendering 12 times per click. The problem isn’t the framework — it’s that you never added memo where it mattered, you never lazy-loaded heavy sections, and you don’t know where to look to find the bottlenecks. Let’s start there.

What problem does React memo solve compared to a component without memo?

By default, React re-renders a component whenever its state changes or its parent re-renders. If you have a ProductList that filters 500 products and each card contains a ProductCard with sub-components, changing even one filter character triggers the whole tree. React.memo is a higher-order component that performs a shallow comparison of props. If props haven’t changed, the component skips rendering.

When to use it and when to avoid it

Use it on pure components that receive the same props most of the time. Don’t use it on components whose props always change (e.g., a counter that increments every second) — the comparison costs more than the re-render itself. In a dashboard project for an SME, we reduced re-renders by 40% on a 1000-row table by applying memo only to rows that never changed (e.g., read-only fields).

Sponsored Protocol

import React, { memo } from 'react';

const ProductCard = memo(function ProductCard({ name, price, image }) {
  console.log('Rendering:', name); // useful for debugging
  return (
    
{name}

{name}

${price.toFixed(2)}

); }); export default ProductCard;

Practical checklist for memo

  • Does the component receive props that rarely change?
  • Is the component pure (same input = same output)?
  • Have you measured the comparison cost with the profiler?
  • For object/function props, use useMemo or useCallback in the parent to avoid always-different references.

How to implement React lazy and Suspense to reduce the initial bundle?

The initial JS bundle of a React app grows fast: a chart library, a Markdown editor, an admin module. Loading everything upfront makes the first load slow. React.lazy lets you load a component only when it’s needed, and Suspense handles the fallback (spinner, skeleton).

Sponsored Protocol

Practical example: deferred loading of a heavy module

import React, { lazy, Suspense } from 'react';

const AdminPanel = lazy(() => import('./AdminPanel'));

function App() {
  const [showAdmin, setShowAdmin] = useState(false);

  return (
    
Loading…
}> {showAdmin && }
); }

Common mistakes with lazy

  • Don’t use it on components visible immediately: the first render waits for the download, worsening First Paint. Use it only for routes or content below the fold.
  • Forgetting the fallback: without Suspense, React.lazy won’t work — it throws an error.
  • Not combining it with route-level code splitting: in React Router, lazy loads each route separately.

We applied this on a fashion e-commerce with 3000 SKUs: the initial bundle went from 2.8MB to 1.1MB, and Time to Interactive dropped from 7.2s to 3.4s. The margin on that store? +12% conversions.

Sponsored Protocol

How to profile a React app with React DevTools Profiler to identify bottlenecks?

Profiling is a blind spot for many developers. “The app is slow” is not a bug report — it’s a symptom. With the React DevTools Profiler you can record a session and see exactly who re-renders, for how long, and why.

Steps for effective profiling

  1. Open React DevTools in Chrome/Firefox, go to the Profiler tab.
  2. Click the red record button (or use the console command window.__REACT_DEVTOOLS_GLOBAL_HOOK__ for automatic triggers).
  3. Interact with the UI: filter, scroll, open modals — do exactly what your real user does.
  4. Stop recording: you’ll see a flame graph. Look for wide, red bars — they indicate components that take significant time.
  5. Click on a bar: in the right panel you’ll see “why did this render?”: changed props, state, or context.

Example: debugging with the profiler

// If you see MyComponent re-rendering because a new function is passed as a prop:
// Before (creates a new function every render of the parent):
 doSomething(id)} />

// After (with useCallback):
const handleClick = useCallback(() => doSomething(id), [id]);

How to combine memo lazy and Suspense for an optimal loading flow?

These three techniques don’t live in isolation: memo prevents unnecessary re-renders, lazy reduces the initial bundle, Suspense manages loading states. Together they form a robust pattern.

Sponsored Protocol

Recommended architecture for React apps with heavy sections

import React, { lazy, Suspense, memo } from 'react';

const HeavyChart = lazy(() => import('./HeavyChart'));

const ChartWrapper = memo(function ChartWrapper({ data }) {
  return (
    }>
      
    
  );
});

export default ChartWrapper;

In this example: ChartWrapper is memoized — if data doesn’t change, it skips re-render. HeavyChart is lazy-loaded — it doesn’t enter the initial bundle. Suspense shows a skeleton while loading. Three problems solved with a simple combination.

Sponsored Protocol

What to do next

  1. Install React DevTools in your browser if you haven’t already. It’s your stethoscope.
  2. Open the Profiler and record 30 seconds of real app usage. Identify the 3 components that re-render the most.
  3. Apply memo to those components if their props don’t change on every render. Verify the reduction in re-renders.
  4. Find the heaviest module (e.g., editor, chart, map) and wrap it with lazy + Suspense. Measure bundle size before/after with webpack-bundle-analyzer or Vite’s rollup-plugin-visualizer.
  5. Read the official docs on React.memo and React.lazy.

Do you have a React app in production? Return to the main React guide for the full picture.

Ing. Calogero Bono

> AUTHOR_EXTRACTED

Ing. Calogero Bono

Ingegnere Informatico, co-fondatore di Meteora Web. Esperto in architetture software, sicurezza informatica e sviluppo sistemi scalabili.
[ Read Full Dossier ]

> METEORA_WEB // DIGITAL AGENCY

We build the digital presence your business deserves.

Websites, social media, online advertising, e-commerce and high-performance hosting, engineered with method by computer engineers in Sciacca, for all of Italy.

> MW_JOURNAL

> READ_ALL()