r/java • • Mar 10 '26

Java 18 to 25 performance benchmark

Hi everyone

I just published a benchmark for Java 18 through 25.

After sharing a few runtime microbenchmarks recently, I got a lot of feedback asking for Java. I also got comments saying that microbenchmarks alone do not represent a full application very well, so this time I expanded the suite and added a synthetic application benchmark alongside the microbenchmarks.

This one took longer than I expected, but I think the result is much more useful.

Benchmark1819202122232425
Synthetic application throughput (M ops/s)18.5518.9418.9822.4718.6618.5522.9023.67
Synthetic application latency (us)1.1301.1271.1251.0751.1291.1281.0641.057
JSON parsing (ops/s)79,941,64077,808,10579,826,84869,669,67482,323,30480,344,57771,160,26368,357,756
JSON serialization (ops/s)38,601,78939,220,65239,463,13847,406,60540,613,24340,665,47650,328,27049,761,067
SHA-256 hashing (ops/s)15,117,03215,018,99915,119,68815,161,88115,353,05815,439,94415,276,35215,244,997
Regex field extraction (ops/s)40,882,67150,029,13548,059,66052,161,77644,744,04262,299,73549,458,22048,373,047
ConcurrentHashMap churn (ops/s)45,057,85372,190,07071,805,10071,391,59862,644,85968,577,21577,575,60277,285,859
Deflater throughput (ops/s)610,295617,296613,737599,756614,706612,546611,527633,739

Full charts and all benchmarks are available here: Full Benchmark

Let me know if you'd like me to benchmark more

129 Upvotes

41 comments sorted by

View all comments

42

u/[deleted] Mar 10 '26

[removed] — view removed comment

15

u/Jamsy100 Mar 10 '26

I used the default GC for all versions

30

u/vips7L Mar 10 '26

The default depends on the number of threads and heap size you have. Likely it picks G1, but there are situations where it would by default pick the serial gc.