MA7: Performance on low-cost phones: lists, start-up, size and battery

Lesson 3 of 5 · reading 15–25 minutes; practice and project time is on the module page

Starting quickly

🎯You'll be able to

Explain what happens at cold start, and make an app show something useful quickly.

🏠The everyday picture

A tea stall that keeps water hot can serve a cup in a minute. One that starts by fetching water and lighting the stove keeps the first customer waiting.

📘What it really is

📝A worked example

Input: KhetNote's starter imports data/demo-photos.json (about 2.6 MB of pictures stored as text) in App.js.

Steps:

  1. Every start loads and parses this file before showing anything, and it's built into the bundle.
  2. Remove the import; if pictures are needed, ship them as image files or download them when used.
  3. Start from the store: show saved visits, then sync.

Expected output: a smaller bundle and a first screen that appears sooner.

🌍Where it's used

📝Case scenario

A travel app parsed a 5 MB list of airports at start-up. On older phones, the splash screen stayed for six seconds. Moving the list into a database queried when needed cut start-up to under two seconds (team's own measurement).

🖱️Try it

Open the starter's App.js and list everything that runs before the first screen draws. Success: you find the demo photos import.

⚠️Common mistakes

🛠️For your project

Project 3's test 6 builds the bundle and checks it's under 2 MB; the starter's is over 4 MB.

✅Quick check

What does Hermes do to help start-up?

Show the answer

It runs precompiled bytecode, which loads faster than plain JavaScript.

What should the first screen show while syncing?

Show the answer

The data already saved on the phone.

← PreviousSmooth long lists
ProLearners Assist