Hello, good evening everyone. I have a plan repla...
# serialization
s
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
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
How’s about speed? Do you know any benchmark on Serialization?
d
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
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:

https://youtu.be/1PwdqkKDCSo?t=1807

❤️ 3
s
Many Thanks.