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/
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.
That’s very cool
What's in the EE of GraalVM that's not in CE? I know about Profile guided optimization, but is there anything else significant?
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.
YMMV, but to get the most out of Graal's JIT you need the Enterprise Edition
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?
the magic I use is a combination of https://github.com/clj-easy/graal-build-time and https://github.com/luontola/clojure-native-image-agent which uses the graalvm Tracing Agent described here https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/
Thanks! I didn't know about native image agent. I'll try that