# Performance & Profiling

> Measure frame rate, re-renders, memory and CPU with profilers, then fix the usual causes of jank in lists, images and state updates. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/mobile/performance-profiling
Last updated: 2026-11-28

Measure frame rate, re-renders, memory and CPU with profilers, then fix the usual causes of jank in lists, images and state updates.

Advanced · about 8 hours · difficulty 4/5

Learn first: [Lists, Scrolling & User Input](https://www.internhack.in/roadmaps/tracks/mobile/lists-and-forms), [App-wide State Tools](https://www.internhack.in/roadmaps/tracks/mobile/state-libraries)

Users do not read performance numbers; they feel them. Dropped frames while scrolling, a slow tap response or a warm phone all make an app feel cheap. The discipline is **measure first, fix second, measure again**, always on a real mid-range device with a release build.

### What to measure

- **Frame rate and frame time:** are frames finishing inside 16 ms?
- **Responsiveness:** time from tap to visible feedback.
- **Memory:** steady growth while navigating signals a leak.
- **CPU, network and battery:** work you do in the background still costs.

### Profilers by stack

- **React Native:** the Perf Monitor overlay, **React DevTools Profiler** to find components that re-render too often, and Hermes sampling profiles. Native tools (Android Studio, Xcode Instruments) still apply underneath.
- **Flutter:** **DevTools** performance view shows UI and raster thread timings; always profile in `--profile` mode.
- **Android:** Android Studio **Profiler**, **Perfetto** system traces and **Macrobenchmark**.
- **iOS:** **Instruments** templates such as Time Profiler, Allocations, Leaks and Hitches.

### Common fixes

- **Lists:** virtualise (FlashList or FlatList, `ListView.builder`, `LazyColumn`, `List`), give items stable keys, keep row components cheap and memoised.
- **Re-renders:** split state so a keystroke does not re-render the whole screen; use `React.memo`, selectors, `const` widgets or stable Compose parameters.
- **Images:** request thumbnails sized for the view, cache them (expo-image, cached_network_image, Coil, Kingfisher).
- **Main thread:** move JSON parsing, crypto and heavy loops off it (workers, isolates, coroutines on `Dispatchers.Default`, Swift tasks).

**Good enough to move on:** you can record a profile of a janky screen, point to the cause in the trace, fix it and show the before and after numbers.

## Key concepts

- **Frame time and jank**
- **Profiling release builds on real devices**
- **React DevTools Profiler**: React Native
- **Flutter DevTools, Android Profiler, Instruments**: per stack
- **List virtualisation and FlashList**
- **Avoiding unnecessary re-renders**
- **Image sizing and caching**
- **Memory leaks**
- **Offloading work from the main thread**

## Mini project

Take a feed screen with 1,000 image rows, record a baseline profile, then apply virtualisation, memoisation and image caching and document the frame time improvement.

## Check yourself

Why is profiling a debug build on an emulator misleading, and what would you do instead?

## Free resources

- [React Native: Performance overview](https://reactnative.dev/docs/performance) (React Native)
- [Flutter: Performance](https://docs.flutter.dev/perf) (Flutter)
- [Android: App performance](https://developer.android.com/topic/performance) (Android Developers)

Previous: [Gestures & Touch Interaction](https://www.internhack.in/roadmaps/tracks/mobile/gestures) · Next: [Startup Time & App Size](https://www.internhack.in/roadmaps/tracks/mobile/startup-and-app-size)

## More in Animations, Gestures & Performance

- [Animations & Transitions](https://www.internhack.in/roadmaps/tracks/mobile/animations)
- [Gestures & Touch Interaction](https://www.internhack.in/roadmaps/tracks/mobile/gestures)
- [Performance & Profiling](https://www.internhack.in/roadmaps/tracks/mobile/performance-profiling)
- [Startup Time & App Size](https://www.internhack.in/roadmaps/tracks/mobile/startup-and-app-size)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Mobile App Developer Roadmap](https://www.internhack.in/roadmaps/tracks/mobile)
