This repository contains a set of microbenchmarks comparing the performance of several popular JVM serialization formats. The goal is to provide realistic, reproducible measurements of:
- Serialization speed
- Deserialization speed
- Payload size
- CPU cost
- Memory pressure
The benchmarks are implemented using JMH (Java Microbenchmark Harness) to ensure statistically meaningful results.
JDK version: 25
mvn clean install
java --add-opens java.base/sun.misc=ALL-UNNAMED -jar target\serialization-benchmarks-jar-with-dependencies.jar
| Benchmark | Mode | Cnt | Score | Error | Units |
|---|---|---|---|---|---|
| JmhSerializationBench.avro_deserialize | thrpt | 5 | 5235,012 | 170,970 | ops/ms |
| JmhSerializationBench.avro_serialize | thrpt | 5 | 3445,741 | 1388,206 | ops/ms |
| JmhSerializationBench.java_deserialize | thrpt | 5 | 353,149 | 7,357 | ops/ms |
| JmhSerializationBench.java_serialize | thrpt | 5 | 1537,298 | 73,347 | ops/ms |
| JmhSerializationBench.kryo_deserialize | thrpt | 5 | 14983,600 | 118,749 | ops/ms |
| JmhSerializationBench.kryo_serialize | thrpt | 5 | 12076,098 | 7002,991 | ops/ms |
| JmhSerializationBench.proto_deserialize | thrpt | 5 | 18465,745 | 239,079 | ops/ms |
| JmhSerializationBench.proto_serialize | thrpt | 5 | 30684,936 | 1023,138 | ops/ms |
The suite currently includes the following serialization technologies: