Relevance of code minification in a performance world
summary
Benchmarks show turning on R8 and code minification yields concrete wins: a test app shrinks ~45% and reduces screen load time ~39%, with dex load dropping from ~2.9s to ~0.07s when fewer dex files remain (single-dex 65,000-reference limit). Wildcard keep rules (for example keeping R classes) can bloat dexes and hurt startup — one innocuous rule raised size ~3% and increased startup ~34%. Use android-optimized.txt, full mode, printconfiguration and add-configuration-debugging, map keep rules to source and test minified builds in CI.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:17Life of code
- 2:23Obfuscation
- 3:40Minification
- 6:20Android Toolchain
- 10:21Test bed project
- 11:14Comparison
- 12:49Code Inlining
- 15:37App Startup
- 19:07Rules can hurt you
- 19:37Case Study
- 20:07Transitive R classes
- 27:11Imported Rules
- 27:53Further Optimisations
- 29:30Debugging Rules
- 30:23Proguard Playground
- 32:05Further Reading
related talks
38mLow effort, High impact Android performance wins
41mShrink, Secure & Optimize Your App With R8
37mEffective ProGuard keep rules for smaller applications
38mOptimize your app performance for the next generation of Android
29m10 Ways To Improve Your Android App Performance
39mAndroid App Performance in a Nutshell
42mPractical Optimizations
38mOptimize your app performance for the next generation of Android
