To add to this, you can also compile an uberjar into a static executable with Graal VM. I use that to build CLI apps for example, and it works wonders.
Keep in mind that your performance for long-running processes will get worse compared to just running a Uberjar as you're missing lots of optimizations going with GraalVM instead of Hotspot
Worth noting, GraalVM's JVM implementation has a different JIT compiler which seems to give better performance for highly dynamic and polymorphic languages like Clojure and Scala
Haven't read the full article but not sure it's accurate, the benchmarking script (https://github.com/inner-product/http4s-native-image/blob/ma...) doesn't even use the server VM and missing other basic optimizations you'd use if you were running a Uberjar in production.
Comments
To add to this, you can also compile an uberjar into a static executable with Graal VM. I use that to build CLI apps for example, and it works wonders.
Keep in mind that your performance for long-running processes will get worse compared to just running a Uberjar as you're missing lots of optimizations going with GraalVM instead of Hotspot
*Unless you're paying for the commercial version
Worth noting, GraalVM's JVM implementation has a different JIT compiler which seems to give better performance for highly dynamic and polymorphic languages like Clojure and Scala
Yes, but in most cases GraalVM would be a preferable choice (https://www.inner-product.com/posts/benchmarking-graalvm-nat...).
Haven't read the full article but not sure it's accurate, the benchmarking script (https://github.com/inner-product/http4s-native-image/blob/ma...) doesn't even use the server VM and missing other basic optimizations you'd use if you were running a Uberjar in production.