4 ms·
yes, and thankyou for answering. Why use Node over the JVM ?
by vbuwivbiu 9y ago
yes, and thankyou for answering. Why use Node over the JVM ?
- Myrmornis 9y agoThat’s answered in the comments elsewhere on this page. Mainly because shell processes are started frequently and the JVM start-up time would be much too slow.
- pjmlp 9y agoJVM starts pretty fast, the problem lies within Clojure's implementation. One can even AOT to native code, if desired.
- Myrmornis 9y agoThe JVM is well-known to start slowly. It's not just clojure. For example, that's why people don't write command-line scripts in scala. I mean this is what I've always read, and is my experience from my limited contact with the JVM, and this is what people who use scala tell me. If you're going to contradict a widely-held belief then you need to provide some justification! Try googling "jvm slow startup".
- pjmlp 9y agoFirst of all, there are AOT native compilers for Java, making as fast to start as any other native compiled language. Second, it is a well known fact in the Clojure community since several years, that the blame lies in Clojure itself. http://blog.ndk.io/jvm-slow-startup.html http://blog.ndk.io/jvm-slow-startup.html https://dev.clojure.org/display/design/Improving+Clojure+Start+Time https://dev.clojure.org/display/design/Improving+Clojure+Sta...
- dkersten 9y ago> Try googling "jvm slow startup". Its slow because a bare bones hello world takes 40ms in Java instead of 1ms in C. Its "slow" relative to other languages, but its not really that slow over all. I can use mvn without noticing that its slow, but leiningen takes multiple seconds to run a command. Take a look at this image, taken from the link pjmlp posted: http://blog.ndk.io/img/jvm_vs_clojure.svg http://blog.ndk.io/img/jvm_vs_clojure.svg Note that the Clojure team are working on improving this, but it will never be as fast as pure Java and certainly never as fast as other languages (including cljs on node)