Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Clojure on JVM is about 80x slower than ClojureScript in this scenario, by the way.


So Javascript compilers are faster than Java now?


Not 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.


I'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 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: