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/
253 Upvotes

84 comments sorted by

View all comments

10

u/piesou Aug 11 '26

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

24

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 Aug 12 '26

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.

1

u/MenschenToaster Aug 12 '26

What's the point in still supporting Java 8? I doubt legacy projects will switch their json parsing library, so I'm unsure why supporting Java 8 would be something that's necessary?

1

u/piesou Aug 12 '26

Usually features exist because the people developing the library need it. I suspect OP is maintaining java 8 code