Skip to content

Performance of (aliased) matrix multiplication with fixed size 3x3 matrices slow

Submitted by Rasmus Munk Larsen @rmlarsen1

Assigned to Nobody

Link to original bugzilla bug (#1615)
Version: 3.4 (development)

Description

The following code:

void foo(float* A, float* B, int iterations) {
Eigen::Matrix<T, 3, 3> R1, R2;
for (int i = 0; i < 9; ++i) {
R1.data()[i] = A[i];
R2.data()[i] = B[i];
}
Eigen::Matrix<T, 3, 3> R1, R2;
for (int i = 0; i < 9; ++i) {
R1.data()[i] = A[i];
R2.data()[i] = B[i];
}
for (int i = 0; i < iterations; ++i) {
R2 = R2 * R1;
}
}

runs about 3x slower with Eigen @ HEAD, compared to our internal branch (a mix of 3.2 and many backports from 3.3 and 3.4). Have there been any significant changes to the this code? Where should I be looking?

Blocking

#814 (closed)

Edited by Eigen Bugzilla