Benchmark & MacroBenchmark
summary
Shows how Jetpack microbenchmark and new macrobenchmark run real-device loops and traces, using Android Studio profiler, trace.h and systrace, with JSON output for CI. Example finds one method costing ~57 ms that makes the render loop drop over 100 ms per frame in an ant-simulation, and microbenchmarks report nanosecond-scale differences for hot paths. Notes need to run benchmarks on the same device, prefer rooted devices for clock stabilization to avoid thermal throttling, and compares repeated launches to expose worst-case startup regressions.
AI-written summary · about
chapters (11)
- 0:00Introduction and setup
- 2:54Why benchmarking matters
- 7:14Micro vs MacroBenchmark tools
- 16:48What to benchmark properly
- 24:23Finding performance bottlenecks
- 26:54MacroBenchmark for startup traces
- 31:12CI integration and regression tracking
- 34:24Key benchmarking tips
- 35:48Live demo of MicroBenchmark
- 40:30Live demo of MacroBenchmark
- 43:29Conclusion and Q&A
