Live data from Hacker News

GraalVM

graalvm.org

1–10 of 108 posts

Re: GraalVM

#2
Does graalvm work with openjdk or any java VM alternative? And does Graalvm have the weird Oracle no business use license that Oracle Java has?

Re: GraalVM

#5
As an engineer who lives and breathes java, both in the context of high performance servers and android apps, can someone explain what this does for me besides for quick startup times through the native image feature? what are the benefits of this?

Re: GraalVM

#6

As an engineer who lives and breathes java, both in the context of high performance servers and android apps, can someone explain what this does for me besides for quick startup times through the native image feature? what are the benefits of this?

Java’s linker is based on an open world assumption, where you can add arbitrary stuff to the classpath and dynamically link it at runtime. This defeats most compiler optimizations, so you’re left with the JIT.

GraalVM makes a closed world assumption, so it can do things like dead code elimination (for library functions that don’t get called), and apply static analysis to inline virtual method calls, perform constant propagation, and so on.

This lets it greatly outperform the JVM, at the expense of some rarely used functionality.

Basically, it’s like switching from the JIT to a C compiler’s -O3.

Re: GraalVM

#7

As an engineer who lives and breathes java, both in the context of high performance servers and android apps, can someone explain what this does for me besides for quick startup times through the native image feature? what are the benefits of this?

Even in JIT mode there is performance improvement due to reduced heap allocation.

Re: GraalVM

#8
post #6

As an engineer who lives and breathes java, both in the context of high performance servers and android apps, can someone explain what this does for me besides for quick startup times through the native image feature? what are the benefits of this?

Java’s linker is based on an open world assumption, where you can add arbitrary stuff to the classpath and dynamically link it at runtime. This defeats most compiler optimizations, so you’re left with the JIT. GraalVM makes a closed world assumption, so it can do things like dead code elimination (for library functions that don’t get called), and apply static analysis to inline virtual method calls, perform constant…

And is that with their javac or is it reserved only for their native image generation?

Re: GraalVM

#9

As an engineer who lives and breathes java, both in the context of high performance servers and android apps, can someone explain what this does for me besides for quick startup times through the native image feature? what are the benefits of this?

You can compile your Java code into an executable which doesn't require Java to be present. Advantages would be reduced memory footprint and quicker startup times, which could be ideal for microservices started on demand instead of constantly running.

That being said, the people at Spring don't recommend it for production use yet. Here's what they have to say about it:

"While GraalVM is now GA, GraalVM native image feature which allows ahead-of-time compilation of Java applications into executable images is only available as an early adopter plugin, so we don't consider it production ready yet."

https://github.com/spring-projects/spring-framework/wiki/Gra...

Re: GraalVM

#10
Can someone please give a sober explanation of what GraalVM, is and how Truffle works?

I think it is somewhat analogous to LLVM: Graal exposes a "language agnostic" API which allows multiple front-ends. There's a front-end for Ruby, JS, C++, others. But this API is higher level than LLVM: it knows about objects, and allows tricks like querying properties across language boundaries.

But I can't imagine what this API looks like! For example, graaljs exists: how do JS semantics get expressed in a Java VM? What does a getProperty instruction look like? How does it know when to invalidate inline caches?

Post reply on HN