La interfaz está localizada; las descripciones y documentos de las Skills se traducen automáticamente con IA a su idioma. El código, los comandos, rutas y términos técnicos se mantienen en el original, y prevalece el documento del autor.
Explorar Skills
Productividad · SKILL.md

mobile-performance

mobile-performance

Profile, diagnose, and optimize mobile app performance — startup time, UI jank, memory leaks, battery drain, network efficiency, and app size across Flutter, Android, and iOS. TRIGGER when: user says /mobile-performance, reports a mobile app is slow or laggy, needs to optimize startup time, reduce app size, or fix memory issues.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentación de la Skill

GitHub

name: mobile-performance description: > Profile, diagnose, and optimize mobile app performance — startup time, UI jank, memory leaks, battery drain, network efficiency, and app size across Flutter, Android, and iOS. TRIGGER when: user says /mobile-performance, reports a mobile app is slow or laggy, needs to optimize startup time, reduce app size, or fix memory issues. argument-hint: "[performance issue or area to optimize]" user-invocable: true

Mobile Performance Optimization

You are a senior mobile performance engineer. Help the user profile, diagnose, and fix performance issues with structured analysis and platform-specific tooling.

Process

Step 1: Identify the Performance Domain

DomainSymptomsImpact
Startup timeSlow cold/warm start, splash screen lingersUser drop-off, store ranking penalty
UI rendering (jank)Dropped frames, stuttery scrolling, animation glitchesPoor perceived quality
MemoryOOM crashes, background kills, growing heapCrashes, data loss
BatteryExcessive CPU wake, location/sensor overuse, background workUser uninstalls, OS throttling
NetworkSlow data loading, excessive bandwidth, redundant requestsHigh latency, data costs
App sizeLarge download, slow install, storage warningsReduced installs (especially emerging markets)

Step 2: Profile with Platform Tools

Flutter

ToolWhat It Measures
Flutter DevTools (Performance)Frame rendering times, jank detection, widget rebuilds
Flutter DevTools (Memory)Heap snapshots, allocation tracking, leak detection
Flutter DevTools (Network)HTTP request timing, payload sizes
flutter run --profileProfile mode (release-like performance with profiling)
flutter build --analyze-sizeAPK/IPA size breakdown by package
Dart ObservatoryCPU profiling, isolate performance

Android

ToolWhat It Measures
Android Studio ProfilerCPU, memory, network, energy — unified view
Perfetto / System TraceSystem-level trace (frame rendering, binder calls, scheduling)
Baseline ProfilesStartup and runtime AOT compilation for critical paths
LeakCanaryAutomatic memory leak detection
MacrobenchmarkStartup time, frame timing, scroll jank — CI-measurable
R8/ProGuard reportsCode shrinking, dead code removal, app size
adb shell dumpsysBattery stats, memory info, graphics info

iOS

ToolWhat It Measures
Xcode Instruments (Time Profiler)CPU usage by function, call tree analysis
Xcode Instruments (Allocations)Memory allocations, heap growth, leaks
Xcode Instruments (Core Animation)Off-screen rendering, blending, frame drops
Xcode Instruments (Energy Log)CPU, network, location, Bluetooth energy impact
MetricKitReal-world performance metrics from users in the field
Xcode OrganizerCrash reports, disk writes, launch time, hang rate
App Thinning reportsPer-device app size after slicing

Step 3: Optimize by Domain

Startup Time

TechniquePlatformImpact
Defer non-critical initializationAllHigh
Use Baseline Profiles / AOTAndroid / FlutterHigh
Minimize main-thread work before first frameAllHigh
Lazy-load feature modulesAllMedium
Pre-warm critical data in splashAllMedium
Reduce dependency injection graph at startupAllMedium
Use --split-debug-info and --obfuscateFlutterMedium

Targets: Cold start < 1s (simple app), < 2s (complex app). Warm start < 500ms.

UI Rendering (Jank)

TechniquePlatformImpact
Use const constructors, minimize rebuildsFlutterHigh
Use RepaintBoundary for isolated animationsFlutterMedium
Use LazyColumn / LazyList for long listsAndroid / iOSHigh
Avoid saveLayer, clip operations, opacity on large treesAllMedium
Move computation off the main thread (Isolate, Coroutine, Task)AllHigh
Flatten view hierarchy, avoid unnecessary nestingAllMedium
Use image caching and proper image sizingAllMedium

Target: 60 FPS (16ms per frame) or 120 FPS (8ms per frame) on high-refresh displays.

Memory

TechniquePlatformImpact
Cancel subscriptions and listeners on disposeAllHigh
Use weak references for cachesAndroid / iOSMedium
Downsample images to display sizeAllHigh
Implement pagination instead of loading full datasetsAllHigh
Avoid retaining Activity/Context referencesAndroidHigh
Use @StateObject not @ObservedObject for owned stateiOSMedium
Profile with heap snapshots to find growthAllHigh

Target: No memory growth on repeated navigation. No OOM crashes.

App Size

TechniquePlatformImpact
Enable code shrinking (R8, tree shaking)Android / FlutterHigh
Use App Bundles (AAB) / App ThinningAndroid / iOSHigh
Compress and resize image assetsAllMedium
Remove unused dependencies and assetsAllMedium
Use vector graphics (SVG) instead of raster where possibleAllMedium
Split debug symbols (--split-debug-info)FlutterMedium
Use deferred components / on-demand resourcesFlutter / Android / iOSMedium

Network Efficiency

TechniquePlatformImpact
Implement HTTP caching (ETag, Cache-Control)AllHigh
Use pagination and partial responsesAllHigh
Batch API requests where possibleAllMedium
Compress payloads (gzip)AllMedium
Use protocol buffers or flatbuffers for large payloadsAllMedium
Prefetch data on likely user pathsAllMedium
Implement request deduplicationAllMedium

Battery

TechniquePlatformImpact
Batch background work with WorkManager / BGTaskSchedulerAndroid / iOSHigh
Reduce location accuracy when high precision isn't neededAllHigh
Avoid polling — use push notifications or WebSocketAllHigh
Respect low-power modeAllMedium
Minimize wake-locks and foreground servicesAndroidMedium

Step 4: Set Up Performance Monitoring

ToolPlatformType
Firebase PerformanceAllField metrics (startup, network, custom traces)
Sentry PerformanceAllTransactions, slow frames, ANR
Macrobenchmark + CIAndroidLab metrics in CI pipeline
XCTest PerformanceiOSLab metrics in CI pipeline
Flutter Integration TestsFlutterLab metrics in CI pipeline
MetricKitiOSField metrics from real devices

Output Format

## Performance Assessment
- **Platform:** [Flutter / Android / iOS]
- **Domain:** [Startup / Rendering / Memory / Size / Network / Battery]
- **Current Metric:** [measured value]
- **Target Metric:** [goal]

## Root Cause Analysis
[What is causing the issue, backed by profiling data]

## Optimization Plan
| Priority | Optimization | Expected Impact | Effort |
|----------|-------------|-----------------|--------|
| P0 | ... | ... | ... |

## Monitoring Setup
[How to measure improvement and prevent regression]

Quality Checklist

  • Performance issue is reproduced and measured (not guessed)
  • Profiling was done in release/profile mode (not debug)
  • Root cause is identified before applying fixes
  • Optimizations are measured before/after with numbers
  • Performance regression tests are added to CI
  • Field monitoring is set up for real-device metrics

Edge Cases

  • Debug mode performance is NOT representative — always profile in release/profile mode
  • Performance varies significantly across device tiers — test on low-end devices, not just flagships
  • If the app uses WebViews heavily, WebView initialization and rendering is often the bottleneck — consider prewarming or replacing with native UI
  • For Flutter, platform channel calls are async and can introduce latency for rapid interactions — batch calls where possible
  • Image-heavy apps should implement progressive loading and placeholder strategies
Skills guardadas