[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using memcpy or memmove instead of for loop in liboctave/array/dim-v
Re: Using memcpy or memmove instead of for loop in liboctave/array/dim-vector.h
Sun, 10 Nov 2013 09:52:34 +0530
On 9 November 2013 22:30, John W. Eaton <address@hidden> wrote:
> Yes, nearly always just 2 or 3 dimensions plus the reference count and
> number of dimensions (they are all stored together in the same array). So I
> doubt that changing the way this copy is done will make much difference.
If the size is going to be small std::copy or memcpy will not improve
the performance. SIMD instruction may have alignment requirements, so
memcpy may check for those. If the size is small memcpy internally can
use for loop after doing some checking. These checking can hamper the
performance. Feels like the current implementation is better.
I thank everyone for taking their time for this.