r/java • u/Jamsy100 • 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.
| Benchmark | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
|---|---|---|---|---|---|---|---|---|
| Synthetic application throughput (M ops/s) | 18.55 | 18.94 | 18.98 | 22.47 | 18.66 | 18.55 | 22.90 | 23.67 |
| Synthetic application latency (us) | 1.130 | 1.127 | 1.125 | 1.075 | 1.129 | 1.128 | 1.064 | 1.057 |
| JSON parsing (ops/s) | 79,941,640 | 77,808,105 | 79,826,848 | 69,669,674 | 82,323,304 | 80,344,577 | 71,160,263 | 68,357,756 |
| JSON serialization (ops/s) | 38,601,789 | 39,220,652 | 39,463,138 | 47,406,605 | 40,613,243 | 40,665,476 | 50,328,270 | 49,761,067 |
| SHA-256 hashing (ops/s) | 15,117,032 | 15,018,999 | 15,119,688 | 15,161,881 | 15,353,058 | 15,439,944 | 15,276,352 | 15,244,997 |
| Regex field extraction (ops/s) | 40,882,671 | 50,029,135 | 48,059,660 | 52,161,776 | 44,744,042 | 62,299,735 | 49,458,220 | 48,373,047 |
| ConcurrentHashMap churn (ops/s) | 45,057,853 | 72,190,070 | 71,805,100 | 71,391,598 | 62,644,859 | 68,577,215 | 77,575,602 | 77,285,859 |
| Deflater throughput (ops/s) | 610,295 | 617,296 | 613,737 | 599,756 | 614,706 | 612,546 | 611,527 | 633,739 |
Full charts and all benchmarks are available here: Full Benchmark
Let me know if you'd like me to benchmark more
View all comments
Show parent comment
2
u/idontlikegudeg Mar 13 '26
Stating it once more doesn’t make it right. The class pointer was reduced to 22 bits. That’s the pointer to the class (meta) data that describes the layout of instances of the class which is shared by all instances of the same class. Reducing the class pointer in size does in theory limit the number of distinct classes (to the mentioned four million), not objects. Just read the JEP.
The four million classes is even mentioned right in the JEP: