OLX Jun 24, 2019

Android Jetpack Benchmark: JSON Parser Performance

Article Summary

Mootaz Ltaief from OLX Engineering put four popular Android JSON parsers head-to-head using Jetpack Benchmark. The results reveal a brutal tradeoff: the fastest parser costs you 1.1 MB of app size.

When OLX slashed their Android app from 23 MB to 11 MB, they discovered Jackson was consuming 1.1 MB alone. This sparked a systematic benchmark of Gson, Moshi, Jackson, and Kotlinx.Serialization using Google's new Benchmark library on a lower-end Huawei Y7 device representing their core userbase.

Key Takeaways

Critical Insight

For Android apps targeting emerging markets or size-conscious builds, Kotlinx.Serialization offers the best balance of speed and footprint, running close to Jackson's performance at a fraction of the size cost.

The article includes the exact benchmark setup and a link to the full source code so you can run these tests on your own JSON payloads and devices.

Recent from OLX

Related Articles