[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
From: |
c. |
Subject: |
Re: Using memcpy or memmove instead of for loop in liboctave/array/dim-vector.h |
Date: |
Sat, 9 Nov 2013 11:28:45 +0100 |
On 9 Nov 2013, at 04:57, PrasannaKumar Muralidharan <address@hidden> wrote:
> Hi Octave maintainers,
>
> In liboctave/array/dim-vector.h clonerep and resizerep functions are
> defined. They use for loop for copying data. Is it possible to use
> memcpy or memmove instead? The mem* function may be faster than for
> loop as its implementation can use SIMD instructions when possible.
>
> Will it be useful or does it make sense?
>
> Thanks and Regards,
> PrasannaKumar
I doubt this would make a huge difference in performance for any application
as dim_vector objects have the size of the number of dimensions in an array,
which is usually a small number.
If you really want to do this change, it sounds like a good exercise in Octave
development, so go ahead and prepare a changeset as suggested by Dan if you
like
to.
I personally think it would look cleaner to use C++ style functions like
std::copy and std::move rather than the C equivalents, though.
I don't see an rule about this in the coding standard, is there a preference
for using either C or C++ standard library functions?
c.