Today, I test big matrices (float) multiplication on my laptop (HP Elitebook 6930p – Duo 2 Core 2×2.4Ghz, 4Gb Ram, Windows 7 32 bit, VS 2010) with OpenCV 2.3.1, Armadillo 3.0.2, Eigen 3.0.5 and OpenBLAS 1.0, C/C++ simple matrices multiplication method and Matlab 2010b 32bit. The program is simple: A = matrix(dim1, dim2, float), B = matrix(dim2, dim3, float), C = A*B, ofcourse I did not include the initial time, just the time for calculation. And here are the results.
|Matrices’ size||C||Armadillo||OpenCV||Eigen||C++ (use STL vector class)||OpenBLAS||Matlab|
It is clear that Matlab is the champion, like in SVD test, but I do not understand why OpenCV is the slowest, even slower than simple C and C++ implementation (C and C++ implementation have the same speed). OpenCV is two times slower than Eigen, Armadillo (in my test – I use OpenBLAS with Armadillo) have the same speed with OpenBLAS. I also notice that simple C/C++, OpenCV, Eigen use only one Core and Armadillo, OpenBLAS and Matlab use both 2 Cores of my machine.