[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pooma-dev] RFA: delete_test1 Modifications
From: |
Jeffrey Oldham |
Subject: |
Re: [pooma-dev] RFA: delete_test1 Modifications |
Date: |
Thu, 24 May 2001 13:48:33 -0700 |
User-agent: |
Mutt/1.2.5i |
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?
Thanks,
Jeffrey D. Oldham
address@hidden
On Thu, May 24, 2001 at 09:49:24AM -0700, James Crotinger wrote:
> Actually, I think "fast code" is one of our prime directives. We should try
> to find a way to do both.
>
> Jim
>
> > -----Original Message-----
> > From: Jeffrey Oldham [mailto:address@hidden
> > Sent: Thursday, May 24, 2001 10:46 AM
> > To: James Crotinger
> > Cc: address@hidden
> > Subject: Re: [pooma-dev] RFA: delete_test1 Modifications
> >
> >
> > On Thu, May 24, 2001 at 09:33:45AM -0700, James Crotinger wrote:
> > > The memmove optimization was fairly substantial when I
> > tested it. I think it
> > > would be better to modify the code to pass addresses to
> > memmove - again this
> > > gets to the question of whether it is really OK to use
> > &a.begin()[0] to be
> > > the address of the 0th element, etc.
> >
> > Yes, I imagine that memmove() is significantly faster than copy(), but
> > I would prefer to have code that is guaranteed to compile rather than
> > fast code that compiles only for certain platforms.
> >
> > > > -----Original Message-----
> > > > From: Jeffrey Oldham [mailto:address@hidden
> > > > Sent: Wednesday, May 23, 2001 6:33 PM
> > > > To: address@hidden
> > > > Subject: [pooma-dev] RFA: delete_test1 Modifications
> > > >
> > > >
> > > > OK to commit?
> > > >
> > > > Compiling src/Utilities/tests/delete_test1.cpp showed
> > that the vector
> > > > type `Array_t' was declared to store doubles but actually stored
> > > > integers. Also, a call to std::memmove() illegally
> > converted vector
> > > > iterators to pointers. The alternative call to
> > std::copy() is instead
> > > > used.
> > > >
> > > > 2001 May 23 Jeffrey D. Oldham <address@hidden>
> > > >
> > > > * delete_test1.cpp (Array_t): s/vector<double>/vector<int>/
> > > > (delete_shiftup_test2): Remove "optimization" call to memmove.
> > > >
> > > > Tested on sequential Linux using gcc 3.0 by compiling the program
> > > > Approved by ???you???
> >
> > Thanks,
> > Jeffrey D. Oldham
> > address@hidden
> >
--
Jeffrey D. Oldham
address@hidden
hello.cc
Description: Text document