- JavaScript thread busy in a first sync
- 14.2 s → 5.1 s
- requests in a sync with nothing new
- 61 → 11
- opening a Sales Order with 15 rows
- 559 → 333 ms
- janky frames with FlashList, on a phone
- 0.04%
Why we measured
Nikolas found two things slow on his phone: opening the app, and Aria’s message box, which stayed under the keyboard so he couldn’t see what he was typing. Before changing anything we measured. We used an API 35 Android emulator with 4 cores, release builds with timing marks that compile to nothing in normal builds, and a dev bench seeded with sales-sized data: 3,813 documents for a sales user to sync.
What was slow, and why
Before and after, on the emulator
| Measurement | Before | After |
|---|---|---|
| First sync of 3,813 documents (2 runs each) | 29.4 s, 37.8 s | 18.4 s, 27.1 s |
| JavaScript thread busy during that sync | 14.2 s | 5.1 s |
| Next sync with nothing new (median of 6) | 2.7 s | 0.9 s |
| Requests in a sync with nothing new | 61 | 11 |
| Opening a Sales Order with 15 rows (median of 12) | 559 ms | 333 ms |
| Cold start to the home screen (median of 20) | 1,360 ms | 1,238 ms |
| Typing 20 characters in Aria with 20 messages shown | 818 ms of rendering | about 100 ms |
Show data
| before | after | |
|---|---|---|
| Sales Order with 15 rows | 559 | 333 |
| Cold start to home | 1,360 | 1,238 |
Memory at the peak of a first sync stayed at about 315 MB. We called the 9% on cold start small and noisy: most of a cold start is React Native’s and Expo’s own start-up, about 440 ms of it native constants, and the app’s own modules take 7 ms.
Then the phone
On Nikolas’s phone, over wireless debugging against our own site, a cold start to a usable home screen took about half a second with or without the fix: 522 and 512 ms in two rounds without it, 498 ms with it. One round with the fix timed out waiting for the home screen, so we have one clean number for it, not two. The keyboard fix showed up right away: Aria’s message box stayed above the keyboard. Afterwards the build he’d had before went back on the phone, byte for byte, with his sign-in and data kept.
FlashList, and the jank that wasn’t
Next we moved the document list from React Native’s FlatList to FlashList 2.0.2. Over 8 alternating rounds of 60 flings through 3,000 customers on the emulator, the JavaScript thread was busy 14.3 s instead of 27.0 s, while loading 1,100 rows instead of 660.
We didn’t ship on the emulator’s word, and we didn’t throw the change out on it either. A jank check on a real phone became a condition for the 0.4.0 release. On the phone, with the same list and 60 flings, three alternating rounds per build:
| FlatList | FlashList | |
|---|---|---|
| Janky frames | 0.17–0.35% | 0.04% |
| 99th-percentile frame | 12 ms | 10–11 ms |
FlashList is smoother on a real phone. The emulator’s high jank readings were noise. The JavaScript-thread result, about half the work while loading more rows, held in all 16 emulator rounds.
Also found
A flaky list-screen test had failed 6 of 6 runs on main when the machine was busy. React Native loads ScrollView, Modal, FlatList and TextInput on first use, which took about 0.6 s in Jest, all inside the test’s first one-second wait. A longer wait alone still failed 2 of 6 runs. The test setup now loads those components up front, and waits 5 s.
All of it reached the 0.4.0 Android test build that evening.