On 22 November I asked for AllKeep Inventory to be measured before anything in it was fixed. On a real phone the app's base APK was 58.6 MB, and 28.8 MB of that was pictures. Eighteen illustrations, each a 1254 by 1254 PNG of 0.9 to 2.2 MB, most shown on screen far smaller than their pixels. This post is the three measurements (an app size, a list, a web page) and the three fixes. The pictures fix has an installed-size number after it (36.2 MB); the Home page fix has no Lighthouse number after it yet.
AllKeep Inventory keeps a list of what you own, room by room and box by box, with photos and values, so there is something to show an insurer after a fire or a burglary. It has a web app and an Android app. It is an experiment: AI coding agents write, test and review it, and I direct them and check what they measure. Every measured number below comes from their runs on 22 November (UTC), and the commands and files are named in the text.
Measure first, one pull request per fix
My instruction was short: measure the apps first, fix the slowest parts, and give the number before and after for each fix, one pull request per fix.
The web pages were measured with Lighthouse 13.6.0 from a headless Chrome, three runs per page and form factor, median taken. The phone run is Lighthouse's default: a simulated Moto G Power on slow 4G with a 4x CPU slowdown. The Android numbers were read over adb from a phone connected to a computer, on the Play build 1.0.5 (version code 23).
1. Half of the base APK was eighteen pictures
On the phone, the installed base APK was 58.6 MB (pm path, then stat on the file). The arm64 split next to it was 31.5 MB. Listing the base APK with unzip -l and keeping what sits under res/drawable-mdpi-v4/assets_images_* gave 28.8 MB, so about half of the base APK. With the split the installed app was 90.1 MB, and the pictures were about a third of that.
Those were 18 pictures: 13 empty states ("nothing here yet" screens), 4 onboarding heroes and the logo. All were 1254 by 1254 RGBA PNGs. They are drawn at 160 to 220 dp, at the screen's width, and at 32 to 40 dp respectively. A phone with a density of 3 needs about 660 pixels for a 220 dp picture, and the file had about twice that.
The fix, in one pull request (#623), converted them to WebP at 768 px for the empty states, 1080 px for the onboarding heroes and 256 px for the logo, and moved the full-size originals out of the app's folder into docs/brand/masters/:
The sizes in that chart are file sizes in the repository, taken from the commit's diff: 25.3 MB of PNG became 2.6 MB of WebP. The logo went from 1.37 MB to 24.9 KB.
A test keeps it from coming back. The next person to drop an export from a design tool into the folder would put the 25 MB back without knowing. So the agents wrote a test that opens the three files that require the pictures, finds every picture they use, and fails on size:
test.each(pictures)("%s exists and is at most 512 KiB", (picture) => {
if (!existsSync(picture)) {
throw new Error(`Missing bundled picture: ${picture}`);
}
const size = statSync(picture).size;
if (size > 512 * 1024) {
throw new Error(`Bundled picture ${picture} is ${size} bytes (limit: 524288)`);
}
});
A second test in the same file caps the total at 4 MiB. The biggest picture now is the sign-in hero at 505,632 bytes, 18 KB under its limit, and the total is 2.64 MB.
Cold start was measured in the same pass: am start -S -W, six runs, 0.73 s (0.71 to 0.80 s). It was already under a second, so it was left alone.
After the change we installed the next build (version code 24) on the same phone and ran the same two commands: pm path, then stat on the base APK. It is 36,203,390 bytes, 36.2 MB, down from 58.6 MB. The commit title had predicted about 35 MB, so the arithmetic was close, and the arm64 split next to it is unchanged at 31.5 MB. One thing is still unexplained: the pictures were 25.3 MB in the repository and 28.8 MB in the APK listing, and nobody has checked whether the build tool adds a copy for another density or whether other files sit under the same path. We did not run the Lighthouse check again after the web fix, so that number stays unmeasured.
2. A list that mounted every row
The Inventory tab shows boxes, and below them the things that are not in a box yet. The list was a FlatList, React Native's virtualized list, but only for the boxes. The unsorted things were rendered in its footer, as ordinary children, so all of them were created at once. With 1,000 unsorted things, rendering the screen in the Jest test renderer mounted 1,000 row components. The fix puts the boxes, the section headers and the rows into one flat list of data for the virtualized list, and the same test now mounts 7 rows. The first 10 cells the list creates also hold 2 boxes and 1 header, which is why it is 7 and not 10.
The test failed with 1,000 before the change and passes with 7 after it, so the screen no longer builds 993 rows nobody can see. How much smoother it is, we cannot say: the test renderer counts components and does not measure frames or memory on a phone, and the test phone has 14 things in it, too few to time a scroll.
3. A web page that scored 34
The landing page and the start page of the web app were fine: 94 and 92 on the phone run, with the largest paint at 1.33 s and 1.06 s. The app's Home, the dashboard a signed-in person sees first, was not:
| Home, signed in, 14 things in 4 boxes | Score | Largest paint | Blocking time | Layout shift |
|---|---|---|---|---|
| Phone (simulated) | 34 | 5.08 s | 979 ms | 0.548 |
| Desktop | 76 | 1.06 s | 36 ms | 0.523 |
Google calls under 0.1 good; both runs were above 0.5, five times that, because the Home component asked for the dashboard numbers and mounted ten cards (fed by 11 requests) only after they came back, and each card then started its own request and appeared whenever it answered. Two rounds of requests, one after the other, and every card that appeared pushed the boxes and the stats down the screen. Nine shifts added up to the 0.55.
The fix has two parts. A small hook starts all the cards' requests together, at the top of the page. And the dashboard shows once, when everything has answered or failed, or after four seconds, whichever is first:
const [waitedLong, setWaitedLong] = useState(false);
useEffect(() => {
const timer = setTimeout(() => setWaitedLong(true), 4000);
return () => clearTimeout(timer);
}, []);
const ready =
waitedLong ||
(settled(dashQ) && settled(boxesQ) &&
(isEmpty || (settled(catQ) && cardQs.every(settled))));
settled means the request has data or has failed, so one broken card cannot hold the page. A new account with nothing in it waits only for the counts and the boxes, then shows its first step.
The same report lists what is still heavy after this change and was left for later: 175 KB of the app page's 505 KB of JavaScript is unused when the page loads, and Lighthouse flags 25 KB of old polyfills.
What I still don't know
The Lighthouse run after the Home fix has not been done. The measurement file says so itself: the "after" section is empty, to be filled after the merge and the next Android release. So I know what the page scored before (34, 0.548) and what the fix is meant to do to the layout shift. I do not know what it does to the largest paint.
Waiting for 14 requests (the dashboard counts, the boxes, the categories and the 11 card hooks) means the cards appear when the slowest one answers, and on a slow connection that is later than the first card would have been. During the wait the reader sees the quick actions and four pulsing grey blocks. The four-second cap bounds the damage, but four seconds of grey blocks can score worse than a page that jumps around. The layout shift should fall to near zero; whether the largest paint falls or rises with it, we will find out when the same script runs again.
If you want to see what the app is for, AllKeep Inventory is where you can start a list of your own things, room by room, on the web.
If you have shipped a dashboard of independent cards, which did you pick: one shared placeholder until the slowest card answers, or a placeholder sized to each card, and what did it do to your largest paint on a slow phone?

Top comments (3)
The 512 KiB per-picture regression test is the part I'd steal — a test that fails when the next designer export sneaks a 2 MB PNG into the APK is the only thing that actually keeps the win. 28.8 MB of a 58.6 MB base APK being 18 illustrations is the kind of number that makes the fix obvious once it's measured, and the empty states going 17.3 MB to 0.9 MB as WebP is a brutal before/after.
One question: with the cold start already at 0.73s, did the smaller APK change install or first-launch time at all on that same phone, or was the win purely download size?
On the 25.3 vs 28.8 MB gap:
unzip -vshows the stored size next to the uncompressed one, and AAPT2 re-crunches PNGs in release builds, so the bytes in the APK don't have to match the repo files. Worth checking before suspecting a second density copy.On your closing question: placeholders sized to each card (a fixed min-height per card type) have worked better for us than one shared gate. Layout shift drops to near zero the same way, but the first card to answer can become the LCP element instead of waiting for the slowest of 14 requests.
Since this is React Native, was the iOS build checked too? Metro bundles the same
required images into the iOS app, so the same 25 MB was probably in the IPA as well. If the WebP files ship to iOS now, a quick check that they render on the oldest iOS version you support is worth doing.