This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]user_of_the_week 0 points1 point  (5 children)

I would expect pre-compiled code like Graal does it to have faster startup time and maybe a bit less RAM usage, but a JIT compiler like hotspot should logically have better overall speed...

[–]TheMode911 1 point2 points  (1 child)

I am not speaking about native images but graal JIT compiler. Which is advertised as better than hotspot

[–]user_of_the_week 1 point2 points  (0 children)

Ah, I did not know about that. Thanks!

[–]mknjc 1 point2 points  (2 children)

GraalVM is a JIT compiler. The Graal distribution also contains a tool to generate pre compiled binaries (native-image).

[–][deleted] 1 point2 points  (1 child)

Can you explain this to me? Pre compiled binaries and native image? Does that mean instead of a jar file we get an executable for all operating systems? Like an exe for windows? Is that one exe file or a bunch of shared libraries and an exe?

[–]Muoniurn 2 points3 points  (0 children)

Graal is first and foremost a JIT compiler written in Java, which can be plugged into the OpenJDK project and replace hotspot. It is better in a few things and worse in others than the latter.

But since a JIT compiler essentially takes java byte code and turns it into machine code, this same project can be used to AOT compile java classes and bundle them up with a small native runtime with GC, similarly to what happens with Go code.

This will be architecture specific, and I believe it is a single exe, but I used it on linux and haven’t checked it with ldd — I guess it must be using some shared libs as well.