Superpack: Pushing the limits of compression in Facebook’s mobile apps
Article Summary
Meta's Superpack compression tech achieves what traditional tools couldn't: keeping app size in check while developers ship code at massive scale daily.
Meta Engineering developed Superpack, a novel compression technique that combines compiler analysis with data compression. It targets the unique challenge of managing app size across Facebook, Instagram, WhatsApp, and Messenger as billions of lines of code get added continuously.
Key Takeaways
- Achieves over 20% better compression than Android's default Zip compression
- Uses compiler techniques like AST grouping to find longer repeating code sequences
- Applies Kolmogorov complexity theory: compress data as programs that generate it
- Targets Dex bytecode, ARM machine code, and Hermes JavaScript bytecode
- Modular architecture written in OCaml and C for asymmetric compression
Critical Insight
Superpack has substantially reduced download sizes for Meta's Android apps, saving bandwidth for billions of users worldwide, especially in regions with limited mobile connectivity.