Performance Profiling
A step-by-step workflow for profiling React component renders, finding unnecessary re-renders, and identifying optimization targets.
Scenario
Your product list screen feels sluggish when scrolling. You want to find which components are re-rendering too often and whether React.memo can help.
Step 1: Start profiling
Begin render profiling, optionally filtering to specific components.
Or focus on specific components:
Step 2: Perform the problematic interaction
Scroll through the product list to trigger re-renders. Use swipe to simulate scrolling:
Repeat a few times to accumulate render data:
Step 3: Get the render report
Example response:
Step 4: Analyze the results
From the report:
Headerre-rendered 5 times with no prop changes → triggered by parent re-renders → wrap withReact.memoPriceLabelre-rendered 36 times with no prop changes → also aReact.memocandidateProductCardrendered 48 times total, 12 mounts — this is expected for a scrolling list with recycling
Step 5: Verify after optimization
After applying React.memo to Header and PriceLabel, profile again:
Repeat the same scroll interaction, then check results:
The unnecessaryRenders section should now be empty or significantly reduced for the optimized components.