Szymon connects delays in app startup and response time to lost users and revenue. He says the session will focus on JavaScript performance, where teams can have a large impact and often make avoidable mistakes.
Master JavaScript Performance in React Native
Speaker
Szymon, a Callstack engineer who led and authored much of the JavaScript section of its React Native optimization guide, presents practical performance techniques with a Callstack host.
A context provider that creates a new value object on every render can trigger renders across its consumers, even when the values are unchanged. Szymon recommends memoizing the value with `useMemo`; in one audited app, he found this issue six times. For FlatList, an inline `renderItem` changes identity on each parent render, so wrapping it in `useCallback` can avoid unnecessary item renders.
JavaScript runs one task at a time, so expensive work can delay user interactions. In a date-formatting example, recreating `DateTimeFormat` for each item took about 20 to 23 milliseconds, while creating it once and reusing it took about 5 milliseconds. Szymon advises profiling first and applying memoization where measurements show a meaningful benefit.
A workflow editor became sluggish because changing one node triggered synchronous validation of the whole workflow, causing about half a second of delay between keystrokes on some devices. Szymon demonstrates splitting divisible work into smaller tasks and yielding between them so JavaScript can handle user events. Wrapping synchronous computation in a promise does not make that computation run in the background.
Takeaways
- Memoize context values when consumers should not update for unrelated provider renders.
- Keep FlatList's `renderItem` stable, and consider selecting data per row to limit updates.
- Reuse expensive objects such as `DateTimeFormat` instead of recreating them during each render.
- Profile on representative devices before adding memoization broadly.
- Split long, divisible JavaScript work into smaller tasks and yield so the app can respond to input.
Mentioned in this talk
Search inside this talk
What was claimed 11
- built
“We've recently released the 2024 edition of the Ultimate Guide to React Native Optimization.”
0:04inWhat’s up in React Native Performance in 2024YouTube Verified2 sources· Talk
- featureThe Ultimate Guide to React Native Optimization: Organized around JavaScript, React, and Native, with guidance on fundamentals, measurement, and best practices
“we decided to structure it around JavaScript, React, and Native”
YouTube Unverified1 source· Talk
- role atSzymon is JavaScript section lead and author for The Ultimate Guide to React Native Optimization at
Callstack“he led the JavaScript part and authored a lot of those pieces”
YouTube Unverified1 source· Talk
- featureReact DevTools: Profiles component renders and helps identify why components rendered
“you can see how your components render over the lifetime of the application”
YouTube Unverified1 source· Talk
- featureContext Engine: Consumers re-render when the provider value has a different reference
“its reference is different. That means every component relying on the theme provider will re-render”
YouTube Unverified1 source· Talk
- featureFlatList: Renders a subset of items around the current viewport
“You only render the subset of items visible in the current viewport”
YouTube Unverified1 source· Talk
- built
“FlashList by Shopify”
YouTube Verified2 sources· Talk
- featureFlatList: Re-renders visible items when the renderItem function reference changes
“FlatList chooses the first option and renders all visible items whenever renderItem changes”
YouTube Unverified1 source· Talk





