Making a heavy Flutter app light again
Finding the real causes of size, cold start and jank in a live commerce app, and fixing them in the order that mattered.
- Role
- Mid Level Software Engineer
- Timeline
- 2026
- Stack
- Flutter, Dart, DevTools, Caching
Context
MoveOn: Global Shop & Shipping is a live cross border commerce app with real customers placing real orders. It had grown feature by feature for a long time, which is the normal way an app gets slow. Nobody makes it slow on purpose. It arrives one reasonable decision at a time.
I led the work to make it light and fast again.
Why this matters commercially, not just technically
The customer base is on mid range Android phones on inconsistent mobile data. For that user:
- Install size is a decision. A large app is one they postpone or cancel on mobile data.
- Cold start is the first impression, repeated daily.
- Jank during browsing is what makes a store feel cheap even when the products are good.
- A slow order placement path is the one that costs money directly.
Framing it that way mattered for prioritisation. It turned a vague request to make the app faster into four specific targets with an obvious order.
The rule I worked to
Measure, fix, measure again. Never guess.
The default reaction to a slow Flutter app is to add const everywhere, wrap widgets in
RepaintBoundary and split them into smaller widgets. Sometimes it helps. Usually it
changes nothing, because the problem was a large JSON parse on the main thread or images
being decoded at four times their display size.
Everything below came out of a profile, in profile mode, on a real device. Debug mode numbers are meaningless and a simulator has a laptop's CPU, which hides exactly the problem you are hunting.
Where the time and the bytes actually were
Install size. The wins here were unglamorous and large: unused dependencies still in
pubspec.yaml, bundled assets that were larger than any surface that displayed them,
multiple icon and font sets where one would do, and shipping a universal binary where per
ABI splits were available.
Cold start. The pattern was work happening before the first frame that did not need to. Third party SDK initialisation, a synchronous read from storage, and a network call the splash screen waited on. Most of it moved to lazy initialisation after first frame. The user gets an interactive screen and the app finishes waking up behind it.
Scrolling and memory. Images were the main cause, as they usually are. Full
resolution product images decoded at source size in a grid is the single most common
memory problem in a commerce app. Decoding at display size with cacheWidth fixes
scrolling and memory pressure at once. Long browsing sessions were the tell: the app was
fine on open and degraded the longer someone shopped, which points at retained memory
rather than slow code.
Caching. The question I kept asking was not how to cache more, but what is being refetched that has not changed. Product and catalogue data is highly cacheable. Order status is not, and caching it would be worse than useless because it is the exact thing a customer opens the app to check. Getting that split right does more for perceived speed than any widget change.
Order placement. This path got treated separately from everything else, because it is where money is. The goal was fewer round trips on the critical path and no avoidable work between the tap and the confirmation.
Decisions and trade-offs
Lazy initialisation over eager setup. Faster to interactive, at the cost of a small window where a feature depending on a not yet ready SDK must handle that state. That handling is real work and it is worth it.
Decode at display size. Much lower memory, at the cost of an image that looks soft if the same widget is later reused at a larger size. Fixable by being deliberate about which sizes exist.
Cache aggressively for catalogue, never for order state. Two different rules in one app is more complexity than one rule. Applying either rule to everything would have made the app either stale where it must be fresh, or slow where it did not need to be.
Results
The app is lighter, starts faster and holds up better during long browsing sessions, with the order placement path specifically shortened.
CONTENT NEEDED: put the real before and after numbers here, install size in MB, cold start in ms, frame timings. You measured them, so use them. Numbers are the entire point of a performance case study and this section is weak without them.What I would change
Add a performance budget to the release process. Every one of these regressions arrived one reasonable pull request at a time, and nothing in the pipeline was watching. A size check and a startup trace on every build would have caught most of this before it needed a programme of work to undo.
The transferable part
Performance work is triage, not craftsmanship. The instinct is to fix the code you find ugly. The discipline is to fix the thing the profiler is pointing at, even when it is a dependency you did not write or an asset nobody thought about.