graalvm

genekim 2024-03-04T22:33:20.284829Z

Not related to native-code, but instead the Graal JIT vs HotSpot: A compilation of benchmarks of GraalVM CE vs. Oracle Graal vs. OpenJDK 21, showing that the constant and ever-growing improvements made to the Graal JIT is resulting in beating OpenJDK in more and more benchmarks. I thought this table at end was awesome — if your code represents their benchmark, on x86, it’ll run 23% faster on Oracle GraalVM; 17% faster on arm64. (A naive interpretation, but also technically correct, I think.). https://ionutbalosin.com/2024/02/jvm-performance-comparison-for-jdk-21/

genekim 2024-03-04T22:43:30.854239Z

FWIW, I’ve switched to using Oracle Graal 21 for my REPL sessions. REPL startup time is justly slightly noticeably slower, but certain long-running operations that I bother to time are 10-15% faster.

2024-03-04T23:04:06.016029Z

That’s very cool

littleli 2024-03-19T12:31:41.027839Z

What's in the EE of GraalVM that's not in CE? I know about Profile guided optimization, but is there anything else significant?

genekim 2024-03-19T18:19:45.884839Z

I use the new “oracle graal” version that you can now download and use thru “sdkman” — it does have the risk of potential onerous and dangerous Oracle licensing. But I’m only using on my laptop, so it should be fine? IIRC, it is as fast as the EE edition — it has PGO (which I never use, as it requires a “training step” that I don’t know how to use) and has all the JIT optimizations enabled.

Ben Sless 2024-03-06T16:28:48.814699Z

YMMV, but to get the most out of Graal's JIT you need the Enterprise Edition

markaddleman 2024-03-04T23:31:42.482379Z

I’m pretty new to GraalVM native compilation. My application uses org.clojure/java.data which references java.sql.SQLException in a top-level defmethod. native-image complains that java.sql.SQLException is unintentionally initialized at build time. I’ve tried adding --initialize-at-run-time option but that change the result. Has anyone discovered the magic to make org.clojure/java.data native-image compatible?

markaddleman 2024-03-04T23:49:56.451669Z

Thanks! I didn't know about native image agent. I'll try that

👍 1