freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [pooma-dev] RFA: delete_test1 Modifications


From: James Crotinger
Subject: RE: [pooma-dev] RFA: delete_test1 Modifications
Date: Thu, 24 May 2001 16:17:54 -0700

copy doesn't have the same semantics as memmove and so it is potentially faster (it can only copy overlapping regions if the destination is before the source, which is the case in the shift-up copies, which almost always involve overlapping regions). However, I did a lot of testing with KCC on the SGI and found that for larger moves, memmove was faster. This is why I put a test into the delete_shiftup algorithm to use copy only if the length of the copy was less than 100 (a good round number). Someone (named julianc) has since commented out that code without leaving a comment in the source as to the reason. Looking at the log I see that it was due to VC++ not having a proper std::advance. This should have just been coded around. At any rate, I didn't add this complication lightly. Now perhaps KCC has since written copy to use memmove so I don't know if my investigations from early 2000 are still valid.

  Jim

> For those skipping intermediary emails, the discussion is whether
> memmove() is faster than copy().
>
> Attached is a program that constructs a vector, copies its contents to
> another vector, and then checks the copy for correctness.  On
> Linux/gcc3.0 and Irix6.5/KCC, I cannot find any significant speed
> difference between std::copy and std::memmove for vectors of doubles.
> Given this result, may we use std::copy() everywhere since it is
> guaranteed to compile?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]