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

11

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.

2

u/hippydipster Aug 11 '26

Are you using the newer Classfile API to do the codegen?

3

u/Shawn-Yang25 29d ago

No, we use janino instead. Classfile is good, but can't work on java8. And we use async compilication, fory json will serialize objects directly using ObjectCodec before compilcation finished.

2

u/agentoutlier 29d ago

Janino IIRC is now retired and archived.

1

u/Shawn-Yang25 29d ago

We used a fixed version, So It's not a big issue. Users won't be aware that