Blog · Audits, crashes and speed
Why is my app slow?
By Shahid Hussain, senior mobile & web engineer ·
Most slow apps are slow in one of five places: startup, scrolling, the network, images or memory. Each can be measured before anything changes, and measuring first is what keeps a speed fix from turning into guesswork. Here’s where I look on iPhone, Android and Flutter, and the causes I find most often.
Measure before you change anything
- iPhone: Xcode Instruments (Time Profiler, App Launch, Hangs, Allocations), and the launch time and hang metrics Xcode Organizer collects from real users.
- Android: the Android Studio profilers, Macrobenchmark for startup and scrolling, and the slow start and slow rendering numbers in Play Console’s Android vitals.
- Flutter: DevTools (performance, CPU profiler, memory), always on a real device in profile mode. Debug mode is slow by design and tells you nothing about speed.
Record the same actions on the same device before and after each change, so the improvement is a number rather than an impression.
Startup
Android vitals counts a cold start of five seconds or more as excessive, and Apple suggests aiming for the first frame within about 400 milliseconds. Long before either, users notice. The usual causes:
- Work before the first frame: SDK setup, network calls the app waits for, database migrations, large files read in one go.
- On Flutter, futures awaited before
runApp, such as remote config or several service setups in a row. - On Android, heavy work in
Application.onCreate.
The fix is to show the first screen first: cached or placeholder data immediately, then everything else after the frame is on screen, with services set up when they’re first needed.
Scrolling and animation
A 60 Hz screen gives each frame about 16 milliseconds, and a 120 Hz screen about 8. Anything that runs longer on the main thread drops frames. The common causes:
- Lists that build every row up front: a SwiftUI
VStackwhere aLazyVStackorListbelongs, a FlutterListViewwithchildreninstead ofListView.builder, Compose lists without stable keys. - Work during scroll: decoding images, formatting dates, parsing data for each row as it appears.
- Rebuilding too much: a SwiftUI view that observes more state than it shows, or a Flutter
setStatehigh in the tree that rebuilds the whole screen for one changed value. - Expensive effects on many rows: shadows, blur and transparency stacked in a list.
The network
- Requests made one after another when they could run together.
- Nothing cached, so every screen waits for the network, even when the data hasn’t changed.
- Lists that fetch extra data row by row instead of once per page.
- Payloads far larger than the screen needs.
Test on a slow connection on purpose: Network Link Conditioner on iPhone, network throttling in the Android emulator. Then show what’s cached first, refresh in the background, and fetch the next page before the user reaches it.
Images
Downloading a full-size photo for a thumbnail costs data, decoding time and memory. Request the size you display (an
image service or CDN can resize), decode at that size, and cache in memory and on disk. Android’s Glide and Coil do
most of this for you; on Flutter, cacheWidth and cacheHeight decode an image at the size it’s shown; on iPhone,
ImageIO can create a thumbnail without decoding the full image.
Memory
An app that gets slower the longer it runs usually leaks memory: closures that keep a screen alive after it closes, observers and listeners never removed, Flutter controllers and stream subscriptions never disposed. The operating system eventually ends the app; on iPhone that shows up as an out-of-memory termination, not a crash. Instruments’ Leaks and the memory graph debugger, Android Studio’s memory profiler with LeakCanary, and the DevTools memory view find them.
Fix in order of what people use
Start with the first screen, the main list and the most-used flow. Measure, fix the biggest cost, measure again on the same device, and move to the next. Five small fixes in the right places beat a rewrite.
About the author
Shahid Hussain is a senior mobile & web engineer in Islamabad, Pakistan (UTC+5), with 27+ apps shipped to production in SwiftUI, Flutter, React and Next.js, for Zavi Technology and independent clients.