I posted some answers on the GitHub issue: https://github.com/mikera/core.matrix/issues/228
But in short, you should use one of the optimised implementations if you care about performance. Clojure vectors are very flexible, but aren't really designed for numerical performance. vectorz-clj for example should be pretty good for your needs: (let [v (array :vectorz [5 5 5 5 5 5 5 5 5 5])] (time (dotimes [i 800000] (dot v v))) )"Elapsed time: 22.990836 msecs" On Saturday, 14 March 2015 19:10:58 UTC+8, Byan Jati wrote: > > hello there, i want to ask about core.matrix dot product performance, is > there a technique to optimize dot-product function ? > > Because i found that in Java, C, or even in HipHipArray library, the dot > product performance is extremely faster than core matrix dot product. I > conduct a little benchmark by looping the dot product function until 800000 > steps, and i found in Java = 12 ms, C = 22 ms, and core.matrix = 1300 ms ( > if using core.matrix.dot ), if using hiphip array in clojure, i found its > resulting 300 ms for 800000 iteration dot-product. > > Actually i want to use hiphip array and core matrix when executing the > core.matrix.dot-product, but the function dot-product demanding > double-array format for the input, which is also bottleneck process for > core.matrix because the row of matrix should be cast into double-array form > before running dot-product. > -- 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.