Hacker News new | ask | show | jobs
by astrange 1456 days ago
It doesn't seem like the JVM is that great to me; it's so memory-inefficient that it can't be performant except by brute force, and Java's famous lack-of-expressiveness is reflected in the bytecode too.

Of course it does exist and works, so it's mature which is something. But all constants are in memory instead of on disk, no value types, gigantic headers on every object?

C#/.NET is better here.

2 comments

Do check out the binary-tree benchmark of the benchmark game. You can see how ridiculously ahead of every other managed language Java is when it comes to GC - and while C# and Go can indeed get away with slightly less allocations (until Valhalla happens at least), my experience is that object allocation can’t be that easily avoided in most general purpose applications, and allocation/GC is often the bottleneck at the typical big web application scale. Here Java’s state-of-the-art GC algorithm(s) are pretty much unbeatable.

It is not without reason that FAANG and Fortune500 companies have many/most of their critical web services running on top the JVM (Apple, Google, Amazon, Alibaba, Twitter, etc).

You should update your knowledge on this matter. I suggest reading about GrallVM, Loom, Valhalla and many such topics. JVM also has much wider support in terms of management and 3rd party enterprise tooling.
I'm aware, but GraalVM isn't "the JVM" (HotSpot) and Valhalla hasn't shipped yet.

(I didn't realize but apparently Valhalla is 8 years old now?)

Apparently it has SIMD now, so that's nice.

It's a JVM that solves a lot of the overhead issues. There are multiple other implementations that can provide a level of scale that's available nowhere else (e.g. Azul).

My point is that the JVM has a huge 3rd party driven ecosystem that's moving at scale. It has very deep backend adoption and has many upcoming projects that will make it even better e.g. project leyden, panama, etc.

Just to add that Java already is so performant it is often used for HFT! With the technologies/projects you mentioned it’s only going to be better.