3 ms·
Clojure on JVM is about 80x slower than ClojureScript in this scenario, by the way.
by yegortimoshenko 10y ago
Clojure on JVM is about 80x slower than ClojureScript in this scenario, by the way.
- sooheon 10y agoSo Javascript compilers are faster than Java now?
- sdegutis 10y agoNot really. The code in question: (apply + (range 1e7)) is just summing a bunch of numbers. That's it. It's very easy to optimize for the sake of benchmarks. It's way too trivial to use for any kind of meaningful real-world comparison.
- bad_user 10y agoI'm working on a cross-compiled library and I am able to compare the same code compiled for the JVM and for Javascript, the language used being Scala, which targets the JVM as a primary target and now we also have http://scala-js.org http://scala-js.org which is quite good btw. I can tell you that the answer is definitely no, in my tests V8 being slower than the JVM by a factor ranging between 4 and 10. If you're interested in seeing that in action, you can download the library's source code and run its tests for the JVM and see how that feels in comparison with the same tests being executed for JS. See: https://github.com/monix/monix https://github.com/monix/monix