Profiling and Validation
1. Measure in the right mode
flutter run --profile
- Use a representative physical Android and/or iOS device. Debug mode and emulators are not evidence of production performance.
- Open DevTools and inspect: frame timings, janky frames, UI work, raster work, rebuild behaviour, layout activity, memory, oversized images (Inspector).
- Judge frame budget against the device's actual refresh rate, not a fixed 16 ms.
If no physical device or profile run is possible, say so explicitly in <remaining_issues>; do not guess numbers.
2. Realistic data
- Validate with increasing sizes: hundreds, then several thousand records, and enough history to show scaling.
- Use an existing representative fixture if the project has one. Otherwise create a fixture, label it as synthetic, and keep it clearly separate from production data. Do not invent "production-scale" figures.
3. Baseline then compare
- Record the baseline for the specific flow (screen, scroll, import) before the change.
- Make one change.
- Re-measure the same flow on the same device and data.
- Report only measured values. No invented percentages.
4. Static and automated checks (after each meaningful change)
flutter analyze
flutter test
Run any additional project-specific checks found during the audit. No new warnings attributable to the work. Add or update tests where behaviour is touched.
5. Behaviour checks
- Inspect the affected UI: it looks and behaves the same.
- Calculation regression: where calculation structure changed, run old vs new on identical source data and compare exactly. See flutter-perf-derived-state.
- State boundaries: required widgets still update, unrelated ones do not, nothing is stale, navigation lifecycle correct.
- Lists: scroll a large representative dataset.
- Images: Inspector oversized-image diagnostics where supported.
6. Backend migrations (only if models changed, after explicit approval)
Run the backend's own migration generation and apply commands.
The migration must be intentional, reviewable, and contain no unrelated schema changes. If no model change is needed, do not create migrations.
7. Report
Fill the sections in report-format. State exactly what was investigated, changed, measured, verified. Never claim "fully optimised".
Hard rules
- Act only on what the user asked. Before answering or changing anything, open the relevant files and check what is already done; report only what you checked, never guess, and do not redo finished work. Reason: guesses and repeated work waste the user's credit.
1---2name: flutter-perf-profiling-and-validation3description: >4 Use when capturing a baseline before optimising, confirming an improvement5 after, or whenever a performance claim needs evidence. Measures and validates6 Flutter performance work: flutter run --profile on physical devices, DevTools7 frame timings (UI vs raster), rebuild tracking, memory and oversized-image8 checks, realistic large datasets, flutter analyze and flutter test,9 calculation regression comparison, and backend migration checks when models10 change. Do not use to implement fixes, and never judge performance from debug11 mode.12metadata:13 source: https://skillmd.com/skills/kinwisenz-devops/flutter-perf-profiling-and-validation14---1516# Profiling and Validation1718## 1. Measure in the right mode1920```bash21flutter run --profile22```2324- Use a representative physical Android and/or iOS device. Debug mode and emulators are not evidence of production performance.25- Open DevTools and inspect: frame timings, janky frames, UI work, raster work, rebuild behaviour, layout activity, memory, oversized images (Inspector).26- Judge frame budget against the device's actual refresh rate, not a fixed 16 ms.2728If no physical device or profile run is possible, say so explicitly in `<remaining_issues>`; do not guess numbers.2930## 2. Realistic data3132- Validate with increasing sizes: hundreds, then several thousand records, and enough history to show scaling.33- Use an existing representative fixture if the project has one. Otherwise create a fixture, label it as synthetic, and keep it clearly separate from production data. Do not invent "production-scale" figures.3435## 3. Baseline then compare36371. Record the baseline for the specific flow (screen, scroll, import) before the change.382. Make one change.393. Re-measure the same flow on the same device and data.404. Report only measured values. No invented percentages.4142## 4. Static and automated checks (after each meaningful change)4344```bash45flutter analyze46flutter test47```4849Run any additional project-specific checks found during the audit. No new warnings attributable to the work. Add or update tests where behaviour is touched.5051## 5. Behaviour checks5253- Inspect the affected UI: it looks and behaves the same.54- **Calculation regression:** where calculation structure changed, run old vs new on identical source data and compare exactly. See [flutter-perf-derived-state](../flutter-perf-derived-state/SKILL.md).55- **State boundaries:** required widgets still update, unrelated ones do not, nothing is stale, navigation lifecycle correct.56- **Lists:** scroll a large representative dataset.57- **Images:** Inspector oversized-image diagnostics where supported.5859## 6. Backend migrations (only if models changed, after explicit approval)6061Run the backend's own migration generation and apply commands.6263The migration must be intentional, reviewable, and contain no unrelated schema changes. If no model change is needed, do not create migrations.6465## 7. Report6667Fill the sections in [report-format](../flutter-performance-specialist/references/report-format.md). State exactly what was investigated, changed, measured, verified. Never claim "fully optimised".6869## Hard rules7071- Act only on what the user asked. Before answering or changing anything, open the relevant files and check what is already done; report only what you checked, never guess, and do not redo finished work. Reason: guesses and repeated work waste the user's credit.