4 ms·
> Also, seems the JVM is slowly improving in startup time department. It's not the JVM that makes Clojure JVM slow to start up, try comparing hello world in Ja
by omaranto 6y ago
> Also, seems the JVM is slowly improving in startup time department.
It's not the JVM that makes Clojure JVM slow to start up, try comparing hello world in Java vs hello world in Clojure.
- didibus 6y agoIt's true that Java hello world will be faster than Clojure JVM hello world. That said, a big Java application with lots of classes to load, and lots of static initializers (which would approach the same number as what Clojure requires to be loaded and initialized) would take as much time as it does for Clojure. So when people say that part of the slow startup is Clojure's fault, they mean more that it is implemented in a way that the JVM isn't very fast at starting. But if you look at Clojure implemented on other runtimes, like ClojureScript, the startup times are much faster, because the NodeJS runtime is much faster to start and initialize everything than the JVM is. In effect, if the JVM improves startup times, so will Clojure JVM's startup times be improved. That's why I see this drastic difference between a Clojure hello world on Java 8 vs Java 14.
- snorremd 6y agoIf you don't do aot compilation that might affect startup time negatively as Clojure will need to read and evaluate your code during startup. And now with things like GraalVM and Babashka you can write programs and scripts that starts in a matter of milliseconds.