Unblocking The Main Thread: Solving ANRs and Frozen Frames
summary
Apps freeze at 700 ms and ANRs trigger at 5 s; profiling shows vector drawable init costing ~78 ms each, encrypted SharedPreferences can take up to ~500 ms and retrofit/HTTP setup ~100 ms. Sharing coroutine/dispatcher thread pools cuts idle threads by about 50 threads, moving heavy init off the main looper and loading big images asynchronously with Coil or Glide prevents frozen frames. Baseline profiles yield roughly 20–30% faster startup, Android 14 narrows ST trace delay to 30–50 ms for more accurate ANR captures.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 7:48Main thread bottlenecks
- 13:04Memory pressure and GC
- 22:13First frame rendering
- 27:18Vector drawables and images
- 30:51Debugging ANRs
- 34:04Profiling tools
- 36:32Post-optimization profiling
- 37:36Performance retro
related talks
07mDebugging RN Android Performance
37mUI profiling in examples. Where is my bottleneck?
42mDebugging Application Performance
39mPerformance issues: the usual suspects
06mFrozen Frames in React Native
42mLet the Main Thread Breathe!
43mPerformance in a Kotlin World
29mWhy ANRs are Hard to Solve and What You Can Do to Make it Easier
