Search code examples
c++matrixbenchmarkingmultiplicationinversion

Matrix implementation benchmarks, should I whip myself?


I'm trying to find out some matrix multiplication/inversion benchmarks online. My C++ implementation can currently invert a 100 x 100 matrix in 38 seconds, but compared to this benchmark I found, my implementation's performances really suck. I don't know if it's a super-optimized something or if really you can easily invert a 200 x 200 matrix in about 0.11 seconds, so I'm looking for more benchmarks to compare the results. Have you god some good link?

UPDATE I spotted a bug in my multiplication code, that didn't affect the result but was causing useless cycle waste. Now my inversion executes in 20 seconds. It's still a lot of time, and any idea is welcome.

Thank you folks


Solution

  • This sort of operation is extremely cache sensitive. You want to be doing most of your work on variables that are in your L1 & L2 cache. Check out section 6 of this doc:

    http://people.redhat.com/drepper/cpumemory.pdf

    He walks you through optimizing a matrix multiply in a cache-optimized way and gets some big perf improvements.