Skip to content
Tatu Saloranta edited this page Nov 23, 2016 · 7 revisions

Java JSON Performance Benchmark(s)

Test results

Read into POJO

From stream,

1000x

java -Xmx256m -jar target/microbenchmarks.jar ".*DZoneReadPojo.*read1kFromStream" -wi 4 -i 5 -f 3

Benchmark                                 Mode  Cnt     Score     Error  Units
DZoneReadPojoDslJson.read1kFromStream    thrpt   15  3300.780 ± 219.360  ops/s
DZoneReadPojoJacksonAB.read1kFromStream  thrpt   15  2656.276 ±  35.388  ops/s
DZoneReadPojoJacksonJr.read1kFromStream  thrpt   15  2464.246 ±  46.743  ops/s
DZoneReadPojoJackson2x.read1kFromStream  thrpt   15  2167.503 ±  43.484  ops/s
DZoneReadPojoFastjson.read1kFromStream   thrpt   15  1728.439 ±  18.176  ops/s
DZoneReadPojoBoon.read1kFromStream       thrpt   15  1380.663 ±  20.769  ops/s
DZoneReadPojoGSON.read1kFromStream       thrpt   15  1320.155 ±  19.907  ops/s
DZoneReadPojoMoshi.read1kFromStream      thrpt   15  1157.627 ±  15.874  ops/s
DZoneReadPojoJohnzon.read1kFromStream    thrpt   15   763.704 ±  13.974  ops/s
DZoneReadPojoJuneau.read1kFromStream     thrpt   15   719.453 ±  12.431  ops/s

Read into Map

From stream

1000x, 50 second run

java -Xmx256m -jar target/microbenchmarks.jar ".*DZoneReadMap.*read1kFromStream" -wi 4 -i 5 -f 3

Benchmark                                Mode  Cnt     Score    Error  Units
DZoneReadMapBoon.read1kFromStream       thrpt   50  2741.919 ± 26.308  ops/s
DZoneReadMapJackson2x.read1kFromStream  thrpt   50  2132.034 ± 22.199  ops/s
DZoneReadMapJacksonJr.read1kFromStream  thrpt   50  2129.694 ± 26.173  ops/s
DZoneReadMapDslJson.read1kFromStream    thrpt   50  2001.397 ± 23.964  ops/s
DZoneReadMapFastjson.read1kFromStream   thrpt   50  1658.743 ± 20.924  ops/s
DZoneReadMapGSON.read1kFromStream       thrpt   50  1262.192 ± 32.628  ops/s
DZoneReadMapJsonMoshi.read1kFromStream  thrpt   50   848.240 ±  5.784  ops/s
DZoneReadMapJsonParse.read1kFromStream  thrpt   50   816.606 ±  7.478  ops/s
DZoneReadMapJuneau.read1kFromStream     thrpt   50   814.939 ±  4.124  ops/s
DZoneReadMapJohnzon.read1kFromStream    thrpt   50   723.045 ±  8.839  ops/s
DZoneReadMapJsonIO.read1kFromStream     thrpt   50   375.793 ±  3.105  ops/s

Write POJO

Into stream

1000x, 50 second run

java -Xmx256m -jar target/microbenchmarks.jar ".*DZoneWrite.*write1kUsingStream" -wi 4 -i 5 -f 10

Benchmark                                Mode  Cnt      Score     Error  Units
DZoneWriteDslJson.write1kUsingStream    thrpt   50  13152.402 ± 226.942  ops/s
DZoneWriteJacksonAB.write1kUsingStream  thrpt   50   6056.606 ±  86.008  ops/s
DZoneWriteJackson2x.write1kUsingStream  thrpt   50   4460.183 ± 106.101  ops/s
DZoneWriteJacksonJr.write1kUsingStream  thrpt   50   4198.927 ±  48.558  ops/s
DZoneWriteFastjson.write1kUsingStream   thrpt   50   3690.564 ±  28.652  ops/s
DZoneWriteBoon.write1kUsingStream       thrpt   50   2307.786 ±  27.346  ops/s
DZoneWriteMoshi.write1kUsingStream      thrpt   50   1674.397 ±  28.986  ops/s
DZoneWriteJohnzon.write1kUsingStream    thrpt   50   1400.942 ±  22.736  ops/s
DZoneWriteJsonIO.write1kUsingStream     thrpt   50    902.335 ±  11.359  ops/s
DZoneWriteJuneau.write1kUsingStream     thrpt   50    669.212 ±  11.860  ops/s
DZoneWriteGSON.write1kUsingStream       thrpt   50    596.266 ±   6.413  ops/s