Enhancing App Performance: A Practical Approach at Glance
Article Summary
Glance powers lockscreens for millions across India, Indonesia, Latin America, and Japan. Zero tolerance for lag when you're the first thing users see.
Jai Goyal from Glance's Android team breaks down their performance optimization playbook. They've built a systematic approach combining passive monitoring, profiling, benchmarking, and power analysis to keep their lockscreen experience buttery smooth across diverse OEM integrations.
Key Takeaways
- JankStats library tracks UI jank with heuristics to pinpoint exact causes of frame drops
- Macrobenchmark tests simulate real user flows, not just isolated code snippets
- Custom benchmark build type combines release optimizations with debug signing for accurate testing
- Power Profiler correlates energy consumption with specific app actions in real time
- Logcat filters catch slow frames (30+ dropped), frozen frames (700ms+), and ANRs instantly
Critical Insight
Glance maintains zero lag tolerance on lockscreens by layering passive monitoring, JankStats tracking, macrobenchmarks, and power profiling into their development workflow.