mathnet/mathnet-numerics — pull request #109 by lifebeyondfife (2013-03-31 16:44:48+00:00)
Title: Avoid extreme performance reduction in wide/tall matrix multiplication

I empirically noticed that matrix multiplication was extremely slow for
the matrices I was using i.e. multiplications were taking minutes rather
than seconds. After tracking down the root of the problem, I found it
was in the CacheObliviousMatrixMultiply() implementation, specifically,
where the sum of the column/row dimensions were compared with the
Control.ParallelizeOrder variable.

For significantly skewed matrix multiplication (wide * tall), the
parallelised redistribution greatly reduces performance. By removing the
'k' parameter from the comparison (where k is the number of columns in
the left matrix and the number of rows in the right) the performance is
improved drastically.

For perfectly square matrices, this change reduces performance slightly.

A unit test has been added to include some indicative matrix
multiplications (10x50000 * 50000x10 and 1000x1000 * 1000x1000).