React6 min read
React Performance Profiling
Profile and optimize React app performance.
Sarah Johnson
December 20, 2025
0.0k0
Use React Profiler to find performance issues.
React DevTools Profiler
- Open React DevTools
- Go to Profiler tab
- Click Record
- Interact with app
- Stop recording
- Analyze flame graph
Profiler API
import { Profiler } from 'react';
function onRenderCallback(
id,
phase,
actualDuration,
baseDuration,
startTime,
commitTime
) {
console.log(`${id} took ${actualDuration}ms`);
}
<Profiler id="App" onRender={onRenderCallback}>
<App />
</Profiler>
Chrome Performance Tab
- Open DevTools
- Go to Performance
- Record
- Stop
- Analyze timeline
Lighthouse
npm install -g lighthouse
lighthouse http://localhost:3000
Key Metrics
- FCP (First Contentful Paint)
- LCP (Largest Contentful Paint)
- TTI (Time to Interactive)
- CLS (Cumulative Layout Shift)
Remember
- Profile before optimizing
- Focus on user experience
- Test on real devices
- Monitor in production
Next: Learn bundle optimization!
#React#Performance#Profiler#Advanced