[Numpy-discussion] Performance problems with strided arrays in NumPy

Sasha ndarray at mac.com
Tue Apr 18 20:27:02 CDT 2006


On 4/18/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> [...]
> Apparently,  it is *much* faster to do
>
> ((double *)dst)[0] = ((double *)src)[0]
>
> when you have aligned data than it is to do
>
> memmove(dst, src, sizeof(double))
>
> This is a useful piece of knowledge to have for optimization.

This is not surprising because memmove has to assume arbitrary
alignment and possibility of overlap between src and dst areas.




More information about the Numpy-discussion mailing list