On Tuesday, April 26, 2016 at 5:53:42 AM UTC+2, puzzler wrote: > > On Mon, Apr 25, 2016 at 1:50 PM, Timothy Baldridge <tbald...@gmail.com > <javascript:>> wrote: > >> As someone who has spent a fair amount of time playing around with such >> things, I'd have to say people vastly misjudge the raw speed you get from >> the JVM's JIT and GC. In fact, I'd challenge someone to come up with a >> general use, dynamic language that is not based on the JVM and comes even >> close to the speed of Clojure. >> >> > Julia reportedly outperforms Clojure (I haven't benchmarked it myself). > Julia is designed primarily for numeric computation, but unlike a lot of > other "math languages" like Octave, R, and Matlab whose general programming > constructs are horribly slow, the overall general-purpose machinery of > Julia (function calls, looping, data structures, dispatch, etc.) is said to > be quite fast. > > Speaking of numeric computation, it is, in my opinion, a real weak point > of Clojure. There is a huge perf. penalty for boxed numbers, and since > anything in a Clojure data structure gets boxed, it's rather difficult to > work around Clojure's poor numeric performance for anything more > algorithmically complicated than a super-simple loop. A number of dynamic > languages use tagged numbers (primitive types with a couple bits set aside > to mark the type of the number), and these are going to do much better than > Clojure for a wide variety of math-oriented computational tasks. I've > benchmarked some specific programs in Clojure vs Racket and Racket tended > to come out ahead when there was a lot of arithmetic. >
On the other hand, Julia relies on external native libraries for performance (BLAS, GPU, whatever). The speed of those libraries is not due to the language (usually C or ASM) but to the fact that they use algorithms that are heavily optimized for each hardware architecture. If you'd write vector and matrix functions in plain everyday C, you'd get the same speed as with Java arrays in Clojure or Java, sometimes even slower. In Cloure and Java, you can link to those same libraries that Julia links to, with the same tradeoffs. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.