r/Kotlin • • Aug 11 '26

Apache Fory™ JSON: 10x Faster JSON Serialization Framework for Java

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

9 comments sorted by

4

u/Shawn-Yang25 Aug 11 '26

Apache Fory JSON is a high-performance JSON serialization framework for Java. It maps Java objects to and from standard JSON text and UTF-8 bytes.

In the published benchmarks, it reaches up to 10.91× Jackson’s throughput and 10.89× Gson’s in java-json-benchmark, and up to 5.55× and 10.00× respectively in the jvm-serializers MediaContent benchmark.

It supports JDK 8+, Android, and GraalVM Native Image. JDK17+ Record is also supported.

31

u/ChuffDaMagicDragon Aug 12 '26

How does it compare to Kotlinx serialization?

8

u/Shawn-Yang25 Aug 12 '26

Fory is still faster, https://github.com/chaokunyang/kotlin-json-benchmarks is the benchmark code, here is summary:

RepresentationOperationFory JSON ops/seckotlinx.serialization ops/secMoshi ops/secJackson ops/sec
StringSerialize7,768,7912,196,9011,019,3112,086,059
StringDeserialize3,535,239608,065525,298510,031
UTF-8 bytesSerialize10,970,4482,171,8431,006,4881,962,426
UTF-8 bytesDeserialize3,840,859563,904461,808536,068

RepresentationOperationvs kotlinx.serializationvs Moshivs Jackson
StringSerialize3.54x7.62x3.72x
StringDeserialize5.81x6.73x6.93x
UTF-8 bytesSerialize5.05x10.90x5.59x
UTF-8 bytesDeserialize6.81x8.32x7.16x

12

u/un-pigeon Aug 12 '26

This and how does it compare with Moshi too?

1

u/NeatCheetah3352 Aug 15 '26

Wow, are there people still using JDK 8?

3

u/connyduck Aug 13 '26

It is a Java tool, so how well does it handle Kotlin specifics like nullability and default parameters?

1

u/Fahrrad1337 Aug 14 '26

Amazing, that Fory is even faster than fastjson and wast! Those are usually the benchmark kings! Great Job, u/Shawn-Yang25! Any precautions to take when integrating this in a Kotlin Android project?