useBenchmark hook provides a comprehensive way to measure and analyze FlashList performance. It automatically scrolls through your list while collecting metrics and provides actionable suggestions for optimization.
Quick Start
Add performance profiling to any FlashList in just a few lines:By default, the benchmark starts automatically 3 seconds after the component mounts. This gives the list time to settle before measuring performance.
Manual Control
For production apps or better control over when benchmarks run, use manual mode:Configuration Options
Customize benchmark behavior with these parameters:- startDelayInMs
- speedMultiplier
- repeatCount
- startManually
Control when the benchmark starts automatically:
Understanding Results
The benchmark returns detailed performance metrics:What the Metrics Mean
Average FPS
The mean frame rate during scrolling. Target: 50+ FPS
Min FPS
The worst frame rate encountered. Watch for drops below 30 FPS
Max FPS
The best frame rate achieved. Usually 60 FPS on most devices
Interpreting Performance
Good Performance
Average FPS: 50+Your list performs excellently! Users will experience smooth scrolling even with fast gestures.
Acceptable Performance
Average FPS: 35-50Performance is acceptable but could be improved. Users may notice slight stuttering during fast scrolling.
Complete Example
Automated Suggestions
The benchmark automatically provides actionable feedback:Low JS FPS (< 35)
Low JS FPS (< 35)
Problem: Components are doing too much work on the JavaScript thread.Solutions:
- Optimize
renderItem- remove heavy computations - Memoize components with
React.memo - Reduce state updates and re-renders
- Move animations to the UI thread with Reanimated
- Simplify component tree structure
Small Dataset (< 200 items)
Small Dataset (< 200 items)
Problem: Testing with too few items doesn’t reflect real-world performance.Solutions:
- Test with realistic data sizes (200+ items)
- Use the
useDataMultiplierhook for testing
Best Practices
Test with Real Data
Use production-like data sizes and complexity. Don’t benchmark with 10 items when production has 1000.
Run Multiple Iterations
Use
repeatCount: 3 or higher to average out inconsistencies and get more reliable metrics.Test on Target Devices
Performance varies dramatically between devices. Always test on your minimum supported hardware.
Benchmark Before/After
Run benchmarks before and after optimizations to measure the impact of your changes.
Vary Scroll Speeds
Test with different
speedMultiplier values (0.5x, 1x, 2x) to simulate different user behaviors.Consider User Scenarios
Think about how your users actually scroll. Fast scrollers need different optimization than casual browsers.
Integration with CI/CD
Automate performance testing in your build pipeline:Troubleshooting
Inconsistent results? This is normal! Performance varies based on:
- Device thermal state (throttling)
- Other running apps
- Battery level
- System updates running in background
repeatCount: 5) for more stable results.Related Tools
React DevTools Profiler
Profile React component render performance
Flipper
Debug and profile React Native apps
Performance Tips
Learn optimization techniques
Why FlashList
Understand FlashList’s architecture