Practical guide to performance Benchmarks
summary
Jetpack Benchmark Library replaces slow, flaky profiler loops with repeatable automated tests that run many iterations, stabilize clocks, and avoid debug-mode skew; using it uncovers real fixes (number format + XML textAppearance) that drop scroll time from ~3 ms to ~1 ms — about 62% better scroll performance — and reveals a viewpager2 prefetch bug that yields ~48% improvement when removed. The workflow includes CI integration to auto-detect regressions and Google’s stepfit-style filtering for noisy signals.
AI-written summary · about
chapters (12)
- 0:00Start
- 13:53detect performance problems
- 14:16write automated tests
- 17:01use benchmarks in measuring phase
- 17:27detect performance regressions
- 17:41create a benchmark
- 25:35setting the off screen limit onscreen page
- 26:59setting off-screen page limit to 1
- 29:12retrieve full benchmark report with all results in json files
- 30:13compare the results with the result from the previous build
- 34:37add a different benchmark using query button
- 42:33write ui performance tests
related talks
36mFighting Regressions with Benchmarks in CI
38mYour benchmark may not guide a real application performance
40mMeasure What Matters
29mAndroid Benchmarking and other stories
29mJava Performance Testing for Everyone
46mDo you need the Jetpack Macrobenchmark library?
02h 44mMeasure, don’t guess: benchmarking stories from the trenches
21mBenchmarking Like a Boss
