You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
performs a lot worse (2x minimum, but varies with size, 1000s) than my original naive implementation.
I think I figured out the reason.
The access of the matrix data likely trashes the CPU cache, because it keeps jumping column: B.data[k + i*cols], where i is incremented in the inner loop.
If I swap the loops, I get a back the lost speed.
Before I provide a PR, is there any reason this is does this way?
The text was updated successfully, but these errors were encountered:
I have noticed that
innerProduct
ejml/main/ejml-ddense/src/org/ejml/dense/row/mult/MatrixVectorMult_DDRM.java
Lines 338 to 344 in 2c9d1dc
performs a lot worse (2x minimum, but varies with size, 1000s) than my original naive implementation.
I think I figured out the reason.
The access of the matrix data likely trashes the CPU cache, because it keeps jumping column:
B.data[k + i*cols]
, wherei
is incremented in the inner loop.If I swap the loops, I get a back the lost speed.
Before I provide a PR, is there any reason this is does this way?
The text was updated successfully, but these errors were encountered: