Closed io7m closed 7 years ago
This benchmark performs the multiplication by reading from a pair of direct matrices and writing the result to a heap matrix. This achieves ~5 million ops per second.
This benchmark performs the multiplication by reading from a pair of heap-backed matrices and saving the result to a direct matrix. This achieves ~18 million ops per second!
It therefore seems fair to assume that the bottleneck is in reading from direct matrices.
This is irrelevant now as direct matrices are no longer used for calculations. There's nothing that can be done to speed up the new storage matrix implementation as it's entirely down to the performance of the JDK's ByteBuffer implementation.
Recent benchmarks are showing that heap-backed matrices significantly outperform direct memory backed matrices. In single threaded code, the
MatrixHeapArrayM4x4F
type sustains about ~18 million multiplications per second, where as theMatrixDirectM4x4F
type sustains only ~5 million.Performing the multiplication with heap-backed matrices and saving the result to a direct-memory backed matrix maintains the ~18 million operations per second, so it's not clear exactly where the bottleneck is.