News for hackers. Stuff that matters.
Re:How to Compile Java into Native Binaries with Mill and Graal by sgammon on Tuesday February 04, 2025 @04:00PM (#42938606)
Peak runtime performance is slightly better on JVM, yes. Native Image ships a JIT within your binary so it is not as different as one might think.
Re:How to Compile Java into Native Binaries with Mill and Graal by chii on Tuesday February 04, 2025 @10:01PM (#42943155)
my understanding is that native compile isn't shipping a jit, but is running the jitted code that was produced during compilation. However, if your code is so "dynamic" (aka, has lots of deeply nested inheritance) that it slows down procedure calls from so many levels of indirection, then a JVM runtime will jit a better version of native code when running using runtime information (such as jump directly to the correct virtual function instead of indirection). The compiled version do not have access to this runtime information, so you can't get this sort of optimization.

However, for "simple" code (like arithmetic, or manipulation of bits, arrays etc), i think it's pretty much the same.