It still nagged me that indexing was somewhat slow. These patches improve indexing (and iterations as well) when the index is already checked or known to be in bounds by using unsafe .get_unchecked() variants instead Index::index(). This adds some unsafe code, thus it needs some review/consideration. I am pretty sure its all trivial and safe and the performance gain makes it reasonable.
It still nagged me that indexing was somewhat slow. These patches improve indexing (and iterations as well) when the index is already checked or known to be in bounds by using unsafe .get_unchecked() variants instead Index::index(). This adds some unsafe code, thus it needs some review/consideration. I am pretty sure its all trivial and safe and the performance gain makes it reasonable.