Unblocking The Main Thread: Solving ANRs and Frozen Frames
summary
Shows concrete fixes and measurements: uses Firebase Performance, R8, LeakCanary and a custom jenat trace to find slow spots, shares results like reduced thread count from 180 to 130 by sharing thread pools, and finds okhttp/encrypted‑prefs initialization that took 300ms costing 900ms across features, then moves that work off the main thread or lazy‑inits it. Presents baseline profiles and A/B tests, reports time‑to‑interactive falling from ~12s with measurable gains after each change.
AI-written summary · about
chapters (18)
- 0:00Main thread performance issues
- 3:15Slow rendering and frozen frames
- 6:04ANRs impact on UX
- 8:12Measuring performance in production
- 10:35No single optimization solution
- 11:20Offload work with coroutines
- 13:26Thread pools to reduce memory
- 15:11Startup time with R8 and ProGuard
- 17:20Detecting memory leaks
- 20:26Preventing DI memory leaks
- 21:49Lazy initialization for startup
- 24:16Optimize resources with WebP and Vector Drawables
- 25:40Compose optimizations and recomposition
- 29:12Baseline profiles for faster startup
- 31:36Validating optimizations in production
- 32:39Profiling hidden bottlenecks
- 34:03Android performance retrospective
- 38:39Closing remarks
related talks
32mChasing performance issues methodically
39mPerformance for Conversion! Use Distributed Tracing to Pinpoint Bottlenecks
24mMake the Most of Android Vitals
15mFix performance pitfalls and level up your app with Firebase
22mANR overview at Uber + Leveraging ApplicationExitInfo API
35mIn Search of Performance: the Subtle Art of Android Profiling
53mCheck your app's vitals
37mPerformance Monitoring- 0 to 60 in 40 Minutes
