App Size Reduction at Microsoft SwiftKey
Article Summary
Microsoft SwiftKey slashed their Android app size by 50% and boosted install conversions. Here's the playbook they used to get there.
The SwiftKey team documented their year-long journey reducing app bloat across 72 languages and 650+ keyboard layouts. They tackled everything from ProGuard configs to native libraries, sharing wins and head-scratchers along the way.
Key Takeaways
- Download size dropped 50% (27.6 MB to 14.3 MB) and install size fell 40%
- DEX code gets triple taxed: once in APK, again as VDEX, then as ODEX
- ProGuard config was accidentally disabling most optimizations for years
- Converting keyboard layouts to custom protobuf saved 6 MB alone
- Android App Bundles delivered 3 MB download and 18 MB install savings
Small optimizations across ProGuard, native libraries, resources, and AABs compounded into massive size reductions that increased install conversions in key markets.
About This Article
SwiftKey's ProGuard configuration had been tweaked many times over the years. The team realized they were turning off most optimizations by mistake. The -optimizations flag works as a filter where negated values actually enable everything except what you specify.
Microsoft looked into the ProGuard documentation and added flags that hadn't been used before: repackageclasses, renamesourcefileattribute, and allowaccessmodification. They also turned on arithmetic optimizations that are safe for Android 2.0 and later.
The ProGuard changes cut the DEX method count by 11% and DEX size by 9%. This helped reduce the overall install size by 2%, which came to about 1 MB smaller even with the triple-tax effect on compiled code.