Profile Performance

Measure performance in the right mode on representative hardware.

Build Modes

ModeUse forDo not use for
DebugHot reload, development, assertionsPerformance claims
ProfilePerformance measurement and DevTools profilingStore release
ReleaseDeployment artifact, startup/size/speed validationDebugging development issues

Workflow

flutter run --profile -d <device-id>
flutter build apk --release
flutter build web --release

Use the relevant release build for the target. Use DevTools to inspect frames, CPU, memory, network, and app size.

Usual Flutter Performance Bugs

BugFix direction
Expensive work in build()Move to view model, repository, isolate, or cached state
Giant rebuild scopeLocalize state and split widgets
Missing constMark stable widget subtrees const
Expensive opacity/clipping/saveLayerSimplify rendering or profile exact cost
Intrinsic layout in long listsAvoid intrinsic passes in scrolling layouts
Huge image/assetsResize, cache, and measure app size

Gotcha: Smooth on a workstation emulator does not prove smooth on a budget Android phone or older iPhone.