from Hacker News

Matrix Multiplication in Clojure vs Numpy

by eightysteele on 1/17/12, 7:00 PM with 15 comments

  • by ique on 1/17/12, 8:21 PM

    Even if we don't consider the difference in data structures here, they use wildly different algorithms. Numpy does all the matrix calculations by outsourcing it to BLAS[1] routines that are a mix of C/Assembly, just like the answers detail.

    BLAS is not only written in more efficient code, it's different algorithms altogether. BLAS can do a lot of optimizations that brings the total FLOP count to below what's usually considered required for matrix multiplication. (2m*n^2)

    [1]: http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprogram...

  • by hogu on 1/17/12, 7:56 PM

    love NumPy, that's the whole reason why I started using python.