# How to Measure React Native Performance Deterministically?

Dawid Matyjasik · Nov 17, 2026

A performance fix in a React Native app usually gets checked the same way: run the app, scroll for a while and decide whether it feels faster. But a lot more than your code changes between two tries. Your thumb never swipes at the same speed twice, random mock data builds different rows on each launch, and a phone that has been scrolling for a minute is often already running slower.

A measurement is only worth having if repeating it gives the same result. On a phone, getting there takes more setup than most performance advice admits. This article walks through that setup using list components as the example, because scrolling is where stutter shows up first. The method itself works for any screen.

The examples use React Native on Android, but most steps work for any Android app, native or cross-platform. There are a lot of small details here, and you don’t need to memorize them. At the end of the article there’s a skill with the whole method that you can hand to your coding agent.

## Why phone performance numbers lie

A React Native screen uses several threads to draw each frame. Your JavaScript runs on the JS thread. Scrolling and native animations run on the UI thread. On Android, a render thread then passes the finished frames to the GPU. Any of them can fall behind while the others keep up. The list can keep scrolling while the JS thread is blocked and new rows never arrive. Or JS can sit idle while the UI thread drops frame after frame.

An FPS counter squeezes all of that into one number, and some tools count the time when nothing was drawn as smooth. So the worst case is also the hardest to catch: the screen is clearly stuck and the counter says the app is fine.

The phone doesn’t stay the same during testing either. To save battery and avoid overheating, Android keeps raising and lowering the CPU speed. **The same scroll can run slower after a minute of testing than it did when the phone was cool.** That’s why Google’s own benchmark library pauses its tests when it sees the phone slowing down. Emulators don’t help here. An emulator runs on your laptop’s CPU and GPU, and Google advises against benchmarking on one. Debug builds are even worse, because React Native’s dev mode slows the JS thread down a lot. Always measure a release build on a real phone.

Add a thumb that never swipes the same way twice and data that changes on each launch, and two runs can differ for reasons that have nothing to do with your code. Before a number means anything, four things have to stay fixed: the gesture, the data, the device and the tool that measures.

## Why not just use Perfetto?

[Perfetto](https://perfetto.dev) and the Android Studio profiler record a single run in great detail: every thread, every frame and the work inside it. They’re the tools to reach for when you want to know why a frame was slow. They won’t tell you whether your change made the screen faster. A trace is one run, and one run can be fast or slow by luck. To compare two builds you need many runs under the same conditions and a few numbers you can put side by side. That’s what this method gives you.

The two work well together. Use this loop to see whether something changed, then record a trace to find out why. Traces taken with the same gesture on a cool phone are also much easier to compare.

## Replaying the same swipe every time

A swipe done by hand is never quite the same: a bit faster, a bit longer, or starting from a different spot. When your finger lifts, Android looks at how fast it was moving and uses that to decide how far the list keeps going on its own. A slightly faster flick sends the list further and makes it render more rows. So two runs done by hand test two different amounts of work. The fix is to record the gesture once and let a machine replay it.

[Argent](https://argent.swmansion.com) does this with e2e tests. Each test is a YAML file in `.argent/e2e/` that lists steps like launching the app, waiting for a screen, tapping and swiping. A fast-scroll test can be just a few lines:

```yaml
# .argent/e2e/fling-down.yaml
steps:
  - swipe: { by: { y: -0.6 }, duration: 150 }
  - wait: 500
  - swipe: { by: { y: -0.6 }, duration: 150 }
  - wait: 500
```

The swipe distance is a fraction of the screen, so the same file works on a small budget phone and on a big flagship. The duration is fixed too, which keeps the fling speed the same in every run. If a test needs to stop at an exact spot, `momentum: false` slows the finger down before it lifts, so the list stops where the finger stopped.

You don’t write the file yourself. Argent connects a coding agent to a simulator or a phone. You describe the path in plain words, the agent taps and swipes through the real app, and Argent saves each step to the YAML file. From then on the test lives in your repo, and you can replay it without an agent:

```bash
argent e2e run fling-down --device <adb serial>
```

## Starting each run from the same state

Every run leaves something behind: decoded images, reused rows, memory that hasn’t been cleaned up yet. The next run starts with all of it. So close the app before each run:

```bash
adb shell am force-stop <package>
```

Then open the screen with a deep link, so the time spent navigating stays out of your numbers. Wait until the screen logs that its first rows are visible, and start measuring then. A fixed wait works only until the day the phone is slower. Right before the gesture, reset the frame stats with `dumpsys gfxinfo <package> reset`.

Use the same data in every run, too. A live feed, feature flags and ads change from run to run. A saved API response or a mock server keeps them the same.

Android also changes the app itself over time. In the background, mostly while the phone charges at night, it [compiles the app’s Java and Kotlin code](https://source.android.com/docs/core/runtime/configure#how_art_works), so the same APK can be faster the next morning. Measure the old and the new build in the same session, one right after the other.

## Waiting for the phone to cool down

A hot phone lowers its CPU speed, so a run that starts warm measures part of that slowdown too. Before each run, wait until all of these are true:

- `dumpsys thermalservice` reports status 1 or lower
- no cooling device in `/sys/class/thermal` is active
- every core’s `scaling_max_freq` is back at `cpuinfo_max_freq`
- `dumpsys battery` shows the battery has cooled down

You need all four, because each one catches cases the others miss. Some phone makers lower the CPU speed without turning on a cooling device. And thermal status 1 can come from the outside of the phone being warm while the CPU still runs at full speed.

A heavy screen will still heat the phone while it runs. Keep those runs in the results: the heat a screen produces is part of what it costs.

Before the first run, also check what else is using the CPU:

```bash
adb shell top -n 1 -m 10
```

This lists the ten processes using the most CPU right now. Your app is stopped at this point, so nothing on the list should be using much. If something is, like an app update, a backup or a game left open, close it or wait for it to finish.

## Counting frames instead of trusting FPS

To see what was actually drawn, ask Android. `adb shell dumpsys gfxinfo <package>` reports every frame since the last reset:

```text
Total frames rendered: 1342
Janky frames: 97 (7.23%)
50th percentile: 9ms
90th percentile: 14ms
95th percentile: 19ms
99th percentile: 46ms
```

Read these numbers together. A janky share of 100% can mean constant stutter or a list that froze, and only the frame count tells you which. The 99th percentile shows how long the slowest frames took.

To see which thread is busy, use [Flashlight](https://github.com/bamlab/flashlight), an open-source tool from BAM that works with any Android app without changing its code. A busy JS thread points at React rendering, a busy UI thread at native layout and drawing. Ignore Flashlight’s FPS line, though, because it counts idle time as smooth.

Neither tool sees blank space during a fast fling, because the list keeps scrolling smoothly over rows that haven’t rendered yet. To catch it, give the list a background color that no row uses, record the screen and count that color in every frame.

## Measuring your own screen

Put together, the loop for your own screen is short. Have the agent record the gesture once as an Argent e2e test:

```bash
argent e2e run scroll-feed --device <adb serial>
```

Then let Flashlight replay it a few times before and after your change:

```bash
flashlight test --bundleId com.example.app --iterationCount 5 --skipRestart \
  --beforeEachCommand "./prepare.sh" \
  --testCommand "argent e2e run scroll-feed --device <adb serial> && ./read-gfxinfo.sh" \
  --resultsFilePath before.json

# make one change, install a new release build, run the same command into after.json

flashlight report before.json after.json
```

`prepare.sh` holds the setup steps from earlier: wait for the phone to cool down, stop the app, open the screen with a deep link, wait for the log line and reset gfxinfo. `read-gfxinfo.sh` saves the frame stats after each run, because Flashlight’s report doesn’t include them.

With only one change between the two sets of runs, the report answers a yes-or-no question. If the lines clearly separate, the change did something. If they overlap within the usual spread between runs, it probably did nothing, however it felt in your hand. Five runs per side is a good start. If the results are spread wide, do more. The agent can handle this part too: it reads the JSON and the gfxinfo output and points at the number that moved.

## Trying it on four lists

The rest of this article runs the method on React Native list components. Each one is set up the way its docs describe and renders the same 10,000 rows from the same seeded data. They all live in one release APK, so they share the compiled code, the bundled images and the build: Expo SDK 58, React Native 0.88 with the New Architecture and Hermes, and React 19.3. Every test runs on a Samsung Galaxy S25, in rounds, and the order of the lists changes every round. The app, the e2e tests and the raw results are on [GitHub](https://github.com/dawidmatyjasik/react-native-list-bench).

`FlatList` comes with React Native. It keeps 21 screen heights of rows mounted around what’s visible and unmounts the rest, so a row that scrolls back into view is built again from scratch.

`FlashList` is Shopify’s list. Version 2 is rewritten in JavaScript and needs the New Architecture. It recycles rows: when a row scrolls out of view, its component gets the next item’s props and renders again. Rows with different layouts go to separate pools through `getItemType`. Version 2 also measures each row on its own, so you no longer pass size estimates like in version 1.

`LegendList` is written in TypeScript with no native code. It renders rows into a fixed set of containers that move as the list scrolls. By default, a container mounts a new row component every time it gets a new item. With `recycleItems`, the container keeps the component and passes it the new item, much like FlashList. The two modes behave differently enough that LegendList shows up twice in the results, with and without `recycleItems`, which makes four lists in total.

Each test below ends with a Flashlight report. The big ring at the top is Flashlight’s overall score, and on a phone as fast as the S25 it stays close to 100 for almost every list. So don’t stop there. The differences between the lists are in the rows under it, mostly CPU and memory.

### Cold start

The app starts from a killed process and a deep link opens the feed. The time runs from the moment Android starts the process until the first screen of rows is painted.

![Cold start of FlatList, FlashList, LegendList and LegendList with recycleItems side by side](a21s-cold-start.gif)

### Scrolling at reading speed

Twenty slow swipes without momentum, about 16 seconds in total, close to how fast someone scrolls while reading the feed.

### Fast flings

Fifteen quick flicks, each one starting before the previous scroll has stopped. New rows have to appear faster here than in any other test.

Besides frames and JS thread load, this test also measures blank space. The list background is magenta, a color no row uses. A separate set of runs records the screen during the same gesture and measures how much of each frame is magenta.

![Fast flings on FlatList, FlashList, LegendList and LegendList with recycleItems side by side](a21s-fling-once.gif)

![Flashlight report for the fast flings test](a21s-fling-once-flashlight.png)

### Jumping far into the list

`scrollToIndex` sends the list to rows 2,500, 5,000, 7,500 and 9,999, with up to five seconds for each. The time runs from the call until the target row is painted. A jump that takes longer counts as missed.

This is where FlatList falls behind: in the report below it needs more than three times as long as the others and keeps the CPU far busier. The reason is how it finds rows. FlatList only knows where a row is after it has rendered it. To jump straight to row 5,000 it needs `getItemLayout`, which you can only write if you know every row’s height up front. Without it, [React Native’s docs](https://reactnative.dev/docs/flatlist#scrolltoindex) say `scrollToIndex` can’t reach rows outside the render window. FlashList and LegendList estimate where the row should be from the rows they have already measured, jump there, and correct the position once the rows around it have rendered.

![Jumping far into the list on FlatList, FlashList, LegendList and LegendList with recycleItems side by side](a21s-jump.gif)

![Flashlight report for the jump test](a21s-jump-flashlight.png)

## Summary

There is no single best list. Each one did well in one test and worse in another, and all of these numbers come from one screen on one phone.

On this feed:

- Cold start took the same time on all four lists, within a few milliseconds.
- If memory matters most, FlashList used the least in every test, and FlatList the most.
- If smooth fast scrolling matters most, FlashList and LegendList with `recycleItems` had the fewest janky frames.
- If CPU matters most, the newer lists used less of it than FlatList. During flings, LegendList kept the JS thread the least busy.
- If you jump far into a long list with rows of different heights, FlatList without `getItemLayout` took seconds or missed the row.

Your app will give different numbers. Your rows, your data and your users’ phones all change them. So don’t go by rankings in blog posts and tweets, this one included. Pick the numbers that matter for your screen, measure them the way this article shows, and let them decide.

## The whole method as a skill

That’s a lot of steps to keep in your head, and you don’t have to. The skill below puts the whole method in one place. Save it as `.claude/skills/measure-performance/SKILL.md`, or wherever your agent keeps its skills, and ask the agent to check whether a change made a screen faster.

````markdown
---
name: measure-performance
description: Measure an Android screen's performance so that repeated runs
  give the same result, then compare two builds. Use when asked whether a
  change made a screen faster or slower.
---

# Measure performance the same way every time

Compare a "before" and an "after" build. Change one thing at a time.

## Ground rules
- Release build on a real phone. No emulator, no debug build.
- Same phone, same data and the same recorded gesture in every run.
- Fixed data: a saved API response or a mock server. No live feed, flags or ads.
- Measure both builds in the same session, one right after the other.

## 1. Record the gesture once
Ask which screen and which path to test. Walk that path in the app with
Argent and save it as an e2e test in .argent/e2e/. Swipe distances are a
fraction of the screen, durations are fixed.

## 2. Check the phone before the first run
Run `adb shell top -n 1 -m 10`. If anything besides the system uses a lot
of CPU, ask the user to close it or wait until it finishes.

## 3. Write prepare.sh (runs before every run)
1. Wait until the phone is cool. All of these must hold:
   - `adb shell dumpsys thermalservice` reports status 1 or lower
   - no cooling device in /sys/class/thermal is active
   - every core's scaling_max_freq equals cpuinfo_max_freq
   - `adb shell dumpsys battery` shows the battery has cooled down
2. `adb shell am force-stop <package>`
3. Open the screen with a deep link.
4. Wait for the screen's "first rows visible" log line (add one if the
   screen doesn't log it yet). Never use a fixed sleep.
5. `adb shell dumpsys gfxinfo <package> reset`

## 4. Write read-gfxinfo.sh
Save the output of `adb shell dumpsys gfxinfo <package>` after every run.

## 5. Run both builds
flashlight test --bundleId <package> --iterationCount 5 --skipRestart \
  --beforeEachCommand "./prepare.sh" \
  --testCommand "argent e2e run <test> --device <adb serial> && ./read-gfxinfo.sh" \
  --resultsFilePath before.json
Install the new release build, run the same command into after.json, then:
flashlight report before.json after.json

## 6. Report
- gfxinfo: total frames, janky %, 99th percentile. Read them together.
- Flashlight: JS thread and UI thread CPU, RAM. Ignore its FPS line.
- If before and after overlap within the spread between runs, say there is
  no clear change. If the spread is wide, run more iterations.
- Say which number moved, by how much, and how wide the spread was.
````
