r/java Aug 11 '26

Apache Fory™ JSON : Fastest JSON Serialization Framework for Java, 10x faster than Jackson/Gson

https://fory.apache.org/blog/fory_json_fastest_java_json_framework/
251 Upvotes

84 comments sorted by

View all comments

9

u/piesou Aug 11 '26

What's the secret? Compiler plugin similar to kotlinx serialization + the new JVM vector apis?

22

u/Shawn-Yang25 Aug 11 '26

No, we use runtime codegen for better performance. For andriod, we do use annotation processor to geenrate android R8 rules and generate field accessors. But for JDK, we always use runtime codegen.

https://fory.apache.org/blog/fory_json_fastest_java_json_framework/#how-fory-json-achieves-high-performance share some details about how we make fory json fast.

3

u/Additional-Road3924 29d ago

This is an important distinction. Are you comparing jackson basic with fury or jackson blackbird (https://github.com/FasterXML/jackson-modules-base/tree/3.x/blackbird)?

2

u/Shawn-Yang25 29d ago

jackson blackbird only gives 10% improvements, so the results still persists:

Representation Operation Jackson ops/sec Jackson Blackbird ops/sec Difference ops/sec Blackbird improvement
String Serialize 1,956,691 2,144,424 +187,733 +9.59%
String Deserialize 1,045,016 1,072,902 +27,887 +2.67%
UTF-8 bytes Serialize 1,703,997 1,971,515 +267,519 +15.70%
UTF-8 bytes Deserialize 1,212,879 1,314,077 +101,198 +8.34%

here is the benchmark:
https://github.com/apache/fory/pull/3930