rulinalg
rulinalg copied to clipboard
The implementation of `iter_mut` for `Matrix` is non-optimal
trafficstars
The iter_mut method for BaseMatrixMut produces a SliceIterMut. For Matrix we can do better than this as we know that the matrix data is contiguous. This has notable effects on the apply function:
current:
test linalg::matrix::apply_1000_100 ... bench: 346,624 ns/iter (+/- 29,463)
improved:
test linalg::matrix::apply_1000_100 ... bench: 274,132 ns/iter (+/- 9,047)
These numbers are from #117.
We will probably need to modify the signature of iter_mut to return an Iterator and then override it for Matrix.