Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Deleting the Array.

Thread Tools

Deleting the Array.

peter koch
Posts: n/a

Victor Bazarov skrev:
> peter koch wrote:
> > Victor Bazarov skrev:

> > I believe you will be hard pressed to find modern compilers where
> > std::vector is "much much slower" than std::vector. I even believe you
> > will have problems finding a compiler where you will even notice the
> > difference.

> Visual Studio 2005, optimizing for size, does not inline calls to any
> of 'std::vector' members, which in some cases causes too much overhead
> for function calls when access to a simle array is sufficient. It is
> especially noticeable when done millions of times in a loop.
> > But never mind that. Even if it was the case that std::vector was
> > "much much slower" (say a factor ten),

> How did you guess [the factor] so well?

In that case, I'd have different optimisation settings for the code
with the millions of loops (and remove the "secure checking" "feature"
that is still enabled even at max optimisation.
> > I'd still recommend
> > std::vector to the OP and then - if profiling told you - reluctantly
> > advice about using new []. new [] is so much more errorprone and
> > fragile and the OP obviously not very experienced.

> Never mind the OP's experience. I was talking in general. And trust
> me, I *have* profiled those things.

I did answer in the context of the OP. More experienced programmers
will know to profile and find out how to optimise anyway.


Reply With Quote

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
Deleting data from the file without deleting the file first crea C++ 2 12-28-2012 11:50 PM
Deleting a File from Hardrive and Deleting a SubKey in Registry Harry Barker C++ 2 04-19-2006 09:34 AM
Deleting a wireless network =?Utf-8?B?TGlubmVjb3I=?= Wireless Networking 3 11-06-2005 05:59 PM
Deleting awireless network connection =?Utf-8?B?SGF3a2V5ZTA3Ng==?= Wireless Networking 0 10-23-2005 12:25 AM
Deleting old Network ? =?Utf-8?B?Q2Fyb2xlIFVL?= Wireless Networking 3 10-05-2005 07:45 PM