Optimizing Gson deserialization

后端 未结 5 899
野的像风
野的像风 2021-02-04 08:39

What is the best way to optimize deserialization?

I am currently using the standard Gson.toJson and Gson.fromJson methods for serialization and deserialization of some c

5条回答
  •  梦毁少年i
    2021-02-04 08:50

    The great stuff that matter in optimization for json is to keep all data in just one level.

    If an object have another object as its field, and this field another object and so on, every new consume a little more time to deserialization. If all fields of your object have primitive types, deserialization will be a bit faster.

    Jackson and Gson keep being the best library to help you.

提交回复
热议问题