rulinalg icon indicating copy to clipboard operation
rulinalg copied to clipboard

The implementation of `iter_mut` for `Matrix` is non-optimal

Open AtheMathmo opened this issue 9 years ago • 0 comments
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.

AtheMathmo avatar Sep 11 '16 03:09 AtheMathmo