Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How can a Vector class be optimized ?

Reply
Thread Tools

How can a Vector class be optimized ?

 
 
peter koch
Guest
Posts: n/a
 
      11-10-2006

ma740988 skrev:
> > > Daniel T. wrote:

> >
> > Of course the fact that my computer is faster than yours isn't relevant,
> > it's the percentage difference in the numbers that surprises. I'm
> > showing a 5% increase in speed for the algorithm use, whereas you show a
> > 176% *decrease*. Are you sure you compiled with full optimizations for
> > speed?
> >

> Timing is one of those things that often puzzles me when using the .NET
> compiler ( .NET 05 ). Algorithms almost always seem so much slower
> that conventional loops. Full optimization produce a similar result.


Could you give us the command-line arguments here? Also tell us if you
have removed the extra checking in Visual Studio 2005.
/Peter
>
> Manual iteration
> end CPU time : 7653
> elapsed CPU time : 7.653
>
> Algorithm Use
> end CPU time : 29034
> elapsed CPU time : 21.366
>
> I'm confused.


 
Reply With Quote
 
 
 
 
Daniel T.
Guest
Posts: n/a
 
      11-10-2006
ma740988 wrote:
>
> Timing is one of those things that often puzzles me when using the .NET
> compiler ( .NET 05 ). Algorithms almost always seem so much slower
> that conventional loops. Full optimization produce a similar result.
>
> Manual iteration
> end CPU time : 7653
> elapsed CPU time : 7.653
>
> Algorithm Use
> end CPU time : 29034
> elapsed CPU time : 21.366
>
> I'm confused.


Even more confusing: These numbers are *slower* than when you didn't
compile with full optimization. Maybe you are optimizing for smaller
size rather than faster speed?

 
Reply With Quote
 
 
 
 
ma740988
Guest
Posts: n/a
 
      11-10-2006

peter koch wrote:
> Could you give us the command-line arguments here? Also tell us if you
> have removed the extra checking in Visual Studio 2005.
> /Peter


/Ox /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm
/EHsc /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Wp64 /TP
/errorReportrompt

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
const vector<A> vs vector<const A> vs const vector<const A> Javier C++ 2 09-04-2007 08:46 PM
Initializing vector<vector<int> > and other vector questions... pmatos C++ 6 04-26-2007 05:39 PM
Free memory allocate by a STL vector, vector of vector, map of vector Allerdyce.John@gmail.com C++ 8 02-18-2006 12:48 AM
how the vector is created, how to pass vector to webservices method apachesoap:Vector Rushikesh Joshi Perl Misc 0 07-10-2004 01:04 PM



Advertisments