Rewriting the Network Connection Layer in Our Android Apps
Article Summary
Zomato's Android app was slow. Their network layer was the bottleneck, costing them speed, bandwidth, and user patience.
The Zomato engineering team dissected their entire networking stack—HTTP client, async operations, and data parsing—to identify what was killing performance. They benchmarked alternatives and made bold migration decisions despite the massive code changes required.
Key Takeaways
- Switching from Apache to OkHttp cut average response time by 30%
- Replaced AsyncTask with Retrofit for true concurrent background threads
- GSON beat Jackson and VTD-XML in parsing speed tests
- HTTP/2.0 enabled socket sharing across connections to same host
- Reduced parser code from 30,000 lines to reflection-based approach
Critical Insight
By modernizing their stack with OkHttp, Retrofit, and GSON, Zomato achieved 30% faster responses and dramatically simplified their codebase.