Home

Awesome

English | 简体中文

json-benchmark

Test results

Multi-run test results

small jsonmedium jsonlarge json
Kotlin Serialization165,936 ns997,228 ns2,933,098 ns
JSONReader190,902 ns1,164,605 ns3,412,914 ns
FastJson196,860 ns1,417,077 ns4,218,987 ns
JSONObject258,789 ns1,690,190 ns4,788,937 ns
Moshi303,056 ns1,411,364 ns3,955,789 ns
Gson412,421 ns1,356,564 ns3,557,943 ns
Jackson1,073,504 ns1,798,989 ns3,543,983 ns

One-run test results

small jsonmedium jsonlarge json
Kotlin Serialization4,114,323 ns15,739,688 ns17,428,906 ns
JSONReader630,469 ns2,052,501 ns5,630,261 ns
FastJson61,629,844 ns6,756,823 ns10,529,791 ns
JSONObject580,469 ns2,227,290 ns6,311,667 ns
Moshi4,460,886 ns13,854,792 ns18,951,198 ns
Gson3,319,688 ns5,568,906 ns10,264,635 ns
Jackson15,070,469 ns13,625,521 ns17,914,687 ns

Kudos test results

Kudos is short for Kotlin utilities for deserializing objects. It is designed to make it safer and easier to deserializing Kotlin classes with Gson and Jackson.

Based on the working mechanism of Kudos, it is not difficult to think that the running time of Kudos will be slightly longer than the corresponding JSON serialization framework. The following is a comparison of the running time of Kudos and the corresponding JSON serialization framework:

Multi-run test results

small jsonmedium jsonlarge json
Gson412,375 ns1,374,838 ns3,641,904 ns
Kudos-Gson517,123 ns1,686,568 ns4,311,910 ns
Jackson1,035,010 ns1,750,709 ns3,450,974 ns
Kudos-Jackson1,261,026 ns2,030,874 ns3,939,600 ns
JsonReader190,302 ns1,176,479 ns3,464,174 ns
Kudos-JsonReader215,974 ns1,359,587 ns4,019,024 ns

One-run test results

small jsonmedium jsonlarge json
Gson3,974,219 ns4,666,927 ns8,271,355 ns
Kudos-Gson4,531,718 ns6,244,479 ns11,160,782 ns
Jackson12,821,094 ns13,930,625 ns15,989,791 ns
Kudos-Jackson13,233,750 ns15,674,010 ns18,641,302 ns
JsonReader662,032 ns2,056,666 ns4,624,687 ns
Kudos-JsonReader734,907 ns2,362,010 ns6,212,917 ns

More

Performance comparison of commonly used JSON libraries