Re:Idiomatic Clojure without sacrificing performance
by jwr on Sunday October 24, 2021 @10:39AM
(#28978323)
Yes, I used a single uberjar for the first year or so, but then it got a bit more involved, because of delivery optimizations (nginx, brotli, precompressed files, versioned immutable static content with infinite cacheability, etc). So these days it's an uberjar (AOT-compiled) plus a bunch of files, essentially.
The servers are managed using ansible, and I also have a terraform setup for quickly spinning up a development cluster "in the cloud". Ansible takes a list of servers either from a static file or from terraform.
Re:Idiomatic Clojure without sacrificing performance
by askonomm on Sunday October 24, 2021 @12:00PM
(#28979126)
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.
Re:Idiomatic Clojure without sacrificing performance
by capableweb on Sunday October 24, 2021 @12:13PM
(#28979263)
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
Re:Idiomatic Clojure without sacrificing performance
by _bsless on Sunday October 24, 2021 @12:19PM
(#28979326)
*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
Re:Idiomatic Clojure without sacrificing performance
by askonomm on Sunday October 24, 2021 @12:19PM
(#28979324)
Yes, but in most cases GraalVM would be a preferable choice (https://www.inner-product.com/posts/benchmarking-graalvm-nat...).
Re:Idiomatic Clojure without sacrificing performance
by capableweb on Sunday October 24, 2021 @01:18PM
(#28979947)
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.
Inquiring mind wants to know: how do you deploy your Clojure (Script) webapp on your bare server? Just an "uber war" that you drop there? (bare servers at OVH here btw but I know Hetzner is good too)