Skip to main content

Performance Overview

Learn how to build high-performance React Native applications by understanding optimization techniques, performance bottlenecks, and best practices.

Performance Fundamentals

React Native apps run on three main threads:
  1. JavaScript Thread: Executes your JavaScript code and React logic
  2. Main/UI Thread: Handles UI rendering and user interactions
  3. Native Modules Thread: Processes native module calls
Performance issues typically occur when these threads are blocked or communication between them is inefficient.

JavaScript Engine

React Native supports multiple JavaScript engines: Hermes is optimized for React Native:
Hermes Benefits:
  • Faster app startup time
  • Reduced memory usage
  • Smaller app size
  • Optimized bytecode compilation

JavaScriptCore (JSC)

Default engine on iOS, optional on Android:

Performance Metrics

Key metrics to monitor:

Frame Rate

Target 60 FPS (16.67ms per frame) for smooth animations:

JavaScript Thread Performance

Memory Usage

Monitor memory allocation and garbage collection:

Common Performance Issues

1. Unnecessary Re-renders

Use React.memo and useMemo to prevent re-renders:

2. Bridge Overhead

Minimize JavaScript-to-native communication:

3. Large Lists

Use FlatList or SectionList with proper optimizations:
See Optimizing FlatList for details.

4. Heavy Computations

Move heavy computations off the main thread:

Optimization Techniques

Use Native Driver for Animations

Optimize Images

Lazy Loading

Code Splitting

Use inline requires for better startup time:
See RAM Bundles and Inline Requires for details.

Development vs Production

Development Mode

Development builds include:
  • Additional warnings and checks
  • Source maps for debugging
  • Hot reloading overhead
  • Unoptimized code

Production Mode

Production builds are optimized:
Production optimizations:
  • Minified JavaScript
  • Removed PropTypes checks
  • Disabled dev warnings
  • Optimized native code
  • Bytecode precompilation (Hermes)

Performance Monitoring

React DevTools Profiler

Performance Timeline API

Native Performance Tools

Android:
  • Android Profiler in Android Studio
  • Systrace
  • Method tracing
iOS:
  • Instruments (Time Profiler, Allocations)
  • Xcode Debug Navigator
  • Metal System Trace

Platform-Specific Optimizations

Android

iOS

Performance Checklist

  • Enable Hermes JavaScript engine
  • Use production builds for testing
  • Implement proper list virtualization
  • Optimize image loading and caching
  • Use native driver for animations
  • Minimize bridge traffic
  • Profile and eliminate bottlenecks
  • Implement code splitting
  • Monitor memory usage
  • Test on low-end devices

Next Steps