Moshi uses Okio to optimize a few things that Gson doesn’t.
- When reading field names, Moshi doesn’t have to allocate strings or do hash lookups.
- Moshi scans the input as a sequence of UTF-8 bytes, converting to Java chars lazily. For example, it never needs to convert integer literals to chars.
The benefits of these optimizations are particularly pronounced if you’re already using Okio streams. Users of Retrofit and OkHttp in particular benefit from Moshi.
Further discussion on the origins of Moshi are in my post, Moshi, another JSON Processor.