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

1

u/idontlikegudeg Mar 12 '26 edited Mar 12 '26

How do you come out at -4 million? Did you mean 4 billion? (EDIT: Object pointers are 22 bit with compressed class pointers, so this is correct.) But anyway, I am quite sure that’s not the issue and AFAIK, not even experimental systems with the sole purpose of testing how many classes you can load into a single JVM instance have reached 4 million classes as of today.

Although the feature is considered stable, it is still new, and I am quite ok with the strategy preview -> stable -> default. While it has been thoroughly tested, there still might be an overlooked corner case, and for enterprise systems, enabling new features per default fresh out of preview is the last thing you want.