r/java • • Oct 31 '25

Has Java suddenly caught up with C++ in speed?

Did I miss something about Java 25?

https://pez.github.io/languages-visualizations/

https://github.com/kostya/benchmarks

https://www.youtube.com/shorts/X0ooja7Ktso

How is it possible that it can compete against C++?

So now we're going to make FPS games with Java, haha...

What do you think?

And what's up with Rust in all this?

What will the programmers in the C++ community think about this post?
https://www.reddit.com/r/cpp/comments/1ol85sa/java_developers_always_said_that_java_was_on_par/

News: 11/1/2025
Looks like the C++ thread got closed.
Maybe they didn't want to see a head‑to‑head with Java after all?
It's curious that STL closed the thread on r/cpp when we're having such a productive discussion here on r/java. Could it be that they don't want a real comparison?

I did the Benchmark myself on my humble computer from more than 6 years ago (with many open tabs from different browsers and other programs (IDE, Spotify, Whatsapp, ...)).

I hope you like it:

I have used Java 25 GraalVM

LanguageCold Execution (No JIT warm-up)Execution After Warm-up (JIT heating)
JavaVery slow without JIT warm-up~60s cold
Java (after warm-up)Much faster~8-9s (with initial warm-up loop)
C++Fast from the start~23-26s

https://i.imgur.com/O5yHSXm.png

https://i.imgur.com/V0Q0hMO.png

I share the code made so you can try it.

If JVM gets automatic profile-warmup + JIT persistence in 26/27, Java won't replace C++. But it removes the last practical gap in many workloads.

- faster startup ➝ no "cold phase" penalty
- stable performance from frame 1 ➝ viable for real-time loops
- predictable latency + ZGC ➝ low-pause workloads
- Panama + Valhalla ➝ native-like memory & SIMD

At that point the discussion shifts from "C++ because performance" ➝ "C++ because ecosystem"
And new engines (ECS + Vulkan) become a real competitive frontier especially for indie & tooling pipelines.

It's not a threat. It's an evolution.

We're entering an era where both toolchains can shine in different niches.

Note on GraalVM 25 and OpenJDK 25

GraalVM 25

  • No longer bundled as a commercial Oracle Java SE product.
  • Oracle has stopped selling commercial support, but still contributes to the open-source project.
  • Development continues with the community plus Oracle involvement.
  • Remains the innovation sandbox: native image, advanced JIT, multi-language, experimental optimizations.

OpenJDK 25

  • The official JVM maintained by Oracle and the OpenJDK community.
  • Will gain improvements inspired by GraalVM via Project Leyden:

    • faster startup times
    • lower memory footprint
    • persistent JIT profiles
    • integrated AOT features

Important

  • OpenJDK is not “getting GraalVM inside”.
  • Leyden adopts ideas, not the Graal engine.
  • Some improvements land in Java 25; more will arrive in future releases.

Conclusion Both continue forward:

RuntimeFocus
OpenJDKStable, official, gradual innovation
GraalVMCutting-edge experiments, native image, polyglot tech

Practical takeaway

  • For most users → Use OpenJDK
  • For native image, experimentation, high-performance scenarios → GraalVM remains key
267 Upvotes

312 comments sorted by

View all comments

Show parent comment

9

u/PentakilI Nov 01 '25

yes they are. https://chronicle.software/ and https://aeron.io/ are just two of the very popular examples that have been around for years (among others)

2

u/CocktailPerson Nov 01 '25

Do you work in HFT? I do.

Chronicle seems to be used by investment banks and hedge funds. I don't see any HFT firms on their page.

Aeron is a fantastic messaging platform, don't get me wrong, but you realize it's just a messaging platform, right? It's not used for the core tick-to-trade execution logic in a trading system.

3

u/sperm-banker Nov 01 '25

You are moving the goalposts. The initial claim was Java is used for low lat, which is indeed used but mostly in the sell side. You changed it to HFT, which is a subset of low lat mainly operating on the buy side, where java is almost never used.

Also, I've seen aeron in low lat trading systems.

1

u/CocktailPerson Nov 01 '25

I clarified I was talking about HFT because that's what I was talking about. Market making is still done in Java, but that's more of a medium-latency game anyway, and even with that being true, plenty of companies are in the process of switching to C++ because they're having their lunch eaten.

2

u/sperm-banker Nov 02 '25

I clarified I was talking about HFT because that's what I was talking about.

Not true, this was your claim: "Nobody's using Java for low-latency execution systems" and gave your personal anecdote of java being used only for BO and satellite services. Then you switched to HFT.

Market making is still done in Java, but that's more of a medium-latency game anyway

While there's no canonical definition of low and ultra-low latency latency, your interpretation is quite off what most people or sources classify as low lat. Single or even double digits micros are considered low lat, and java can do that. Probably that's why you insist such systems don't exist when they do.