Home

Awesome

Linear Algebra Performance Benchmarks

List of benchmarks

  1. Create a random 1000x1000 matrix.

  2. Invert a 1000x1000 random matrix.

  3. Compute the Cholesky decomposition of a random 1000x1000 matrix.

  4. Vector (1 000 000) dot product.

  5. Matrix (1000x1000) transpose.

  6. Matrix (1000x1000 <> 1000x1000) multiply.

  7. Sigmoid

  8. ReLU

  9. Sum by rows

  10. sum by columns

  11. indices of max elements in rows

  12. indices of max elements in columns

Results

Benchmarkhmatrix (hmatrix-morpheus)numpyoctavegonum matrixLASwift
1. Random matrix16.10 ms39.24 ms18.48 ms41.98 ms15 ms
2. Invert matrix84.85 ms84.74 ms57.00 ms364.49 ms39 ms
3. Cholesky decomposition28.74 ms29.40 ms9.11 ms116.60 ms33 ms
4. Vector dot product1.965 ms0.80 ms1.07 ms0.990 ms1 ms
5. Matrix transpose41.80 ns262.0 ns22,860 ns0.65 ns11e9 ns
6. Matrix multiply32.78 ms37.01 ms36.38 ms185.65 ms30 ms
7. Sigmoid14.40 ms (9.835 ms)19.76 ms18.14 ms2 333 ms20 ms
8. ReLU3.575 ms (1.389 ms)7.39 ms3.11 ms10.5 ms4 ms
9. sum by rows3.276 ms (1.069 ms)0.546 ms0.830 ms2 ms
10. sum by columns14.690 ms (0.539 ms)0.692 ms1.049 ms13 ms
11. max index by rows1.540 ms (0.830 ms)0.924 ms1.131 ms2 ms
12. max index by columns12.980 ms (0.902 ms)9.940 ms1.460 ms13 ms

TODO: