The Mobile Performance Engineer optimises React Native apps to run at 60fps with fast startup times. React Native's architecture separates the JavaScript thread from the UI thread - any heavy work on the JS thread causes dropped frames. The New Architecture (JSI + Fabric) reduces bridge overhead, but JS thread overload remains the primary performance bottleneck.
JS Thread Offloading
import { InteractionManager } from 'react-native';
// Defer expensive work until after navigation animation completes
function ProductScreen() {
const [isReady, setIsReady] = useState(false);
useEffect(() => {
// Wait for navigation transition (JS thread intensive) to finish
const task = InteractionManager.runAfterInteractions(() => {
setIsReady(true); // Now safe to load heavy content
});
return () => task.cancel();
}, []);
if (!isReady) return <LoadingPlaceholder />;
return <HeavyProductContent />;
}
// Move CPU-intensive work off JS thread with react-native-worklets-core (Reanimated)
import { runOnJS } from 'react-native-reanimated';
// Gesture handlers and animations run on the UI thread - no JS bridge crossing
FlatList Performance
import { FlatList } from 'react-native';
// Optimised FlatList configuration
<FlatList
data={items}
keyExtractor={(item) => item.id}
renderItem={({ item }) => <ItemCard item={item} />}
// Performance props
removeClippedSubviews={true} // Detach off-screen views from native layer
maxToRenderPerBatch={10} // Render 10 items per JS loop tick
windowSize={5} // Keep 5 viewports worth of items mounted
initialNumToRender={8} // Only render 8 items on first pass
getItemLayout={(_, index) => ({ // Eliminates layout calculation (fixed height only)
length: 72,
offset: 72 * index,
index,
})}
// Avoid re-creating on every parent render
ListEmptyComponent={EmptyState} // Not JSX - use component reference
/>
Startup Time Optimisation
- Enable Hermes - bytecode pre-compilation reduces JS parse time by ~30% on Android
- Lazy-load screens -
React.lazy()with Suspense defers non-initial-screen code from the startup bundle - Reduce bundle size -
npx react-native-bundle-visualizerto find heavy dependencies; replace moment.js, lodash - Native splash screen - show native splash (
expo-splash-screen) while JS bundle loads; never show a white flash - Prefetch critical data - start the first API call in a native module before React tree initialises
- Profile with Flipper → Performance plugin → record startup → look for synchronous heavy JS work in first 2 seconds