Hello, good evening everyone.
I have a plan replace Gson to Serialization.
But My project has many modules, they are using Moshi and Gson in Core module ( base module for all of Features)
So What are the pros and cons of using Serialization library?
Is there anything I need to keep in mind when switching from Gson to Serialization?
Thanks.
b
Big Chungus
05/25/2021, 10:49 AM
Kotlinx.Serialization doesn't use reflection and works on MPP projects. Downsides are that only Json format is currently stable and somethimes you'll need to massage it a bit on more complex object serialization/deserialization
Overall I personally am a huge fan of kotlinx.serialization when compared with Gson or Jackson
❤️ 1
➕ 3
s
Sam
05/25/2021, 11:07 AM
How’s about speed? Do you know any benchmark on Serialization?
d
Dariusz Kuc
05/25/2021, 12:12 PM
kotlinx.serialization is in many ways simpler than gson/moshi/jackson yet in others pretty limited - since it relies on compiler it has hard time working with some dynamic map structures (ie handling Map<String, Any> is pretty problematic...)
❤️ 1
c
Colton Idle
05/25/2021, 3:18 PM
Here's a good talk on json and serialization including all of the libraries you mentioned by one of the authors of gson and moshi: