This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Efficiency of memmove vs. generic typed copy


Paolo Carlini wrote:

>Gabriel Dos Reis wrote:
>
>>Do we have evidence that code B is generally faster than code A for
>>the majority of say primary platforms?
>>
>A few days ago I had your very same curiosity. I haven't done extensive
>tests, in particular not checked carefully the effects of restrict, but
>two points seemed obvious:
>1- For short copies, say, less than ~100 chars, the open coded loop was
>*much* faster.
>  
>
Well, a large fraction of this is due to inlining...

>2- For long copies, memcpy was a win, probably not by the same margin,
>but a clear win.
>  
>
... still, I'm consistently seeing this. I think we should first set up
tests comparing out of line open coded loops to out of line memcpy & co.
I haven't done that yet :(

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]