LogoSkills

performance-testing

Flutter performance testing and profiling

Performance Testing#

Triggers#

  • When analyzing Flutter app frame rendering performance
  • When screen transitions or animations become slow
  • When measuring Serverpod API response times
  • When memory leaks are suspected

Actions#

  1. Perform profiling using Flutter DevTools
    • Analyze frame rendering times in the Timeline view
    • Identify hotspot functions with CPU Profiler
    • Detect memory usage and leaks in the Memory view
  2. Perform frame analysis
    • Identify jank frames against 60fps/120fps targets
    • Real-time frame monitoring using PerformanceOverlay
    • Analyze time spent in build/layout/paint phases
  3. Analyze widget rebuild optimization
    • Check usage of const constructors
    • Optimize BLoC buildWhen conditions
    • Review RepaintBoundary usage
  4. Measure Serverpod API performance
    • Benchmark endpoint response times
    • Analyze database query execution plans
    • Test concurrent request handling performance

Output#

  • Performance profiling results report
  • Jank frame list with cause analysis
  • Optimization recommendations (widget rebuilds, query tuning, etc.)
  • Performance benchmark scripts

Notes#

  • Performance should be measured in Flutter's profile mode (--profile) for accurate results
  • Preventing unnecessary State emissions in the BLoC pattern minimizes widget rebuilds
  • Check CoUI component const constructor support and instantiate with const when possible
  • Verify index usage in Serverpod database queries with EXPLAIN ANALYZE
  • For large list rendering, use ListView.builder and CoUI's virtual scroll components