Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > why the efficiency between debug and release version differs so much(VS2005).

Reply
Thread Tools

why the efficiency between debug and release version differs so much(VS2005).

 
 
zhouchengly@gmail.com
Guest
Posts: n/a
 
      11-07-2006
I test a stl sort function in vs2005 and find the efficiency of debug
to release version is about 1000:1, it suprise me and I'm curious what
cause it.

 
Reply With Quote
 
 
 
 
ralph
Guest
Posts: n/a
 
      11-07-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I test a stl sort function in vs2005 and find the efficiency of debug
> to release version is about 1000:1, it suprise me and I'm curious what
> cause it.


Debug version contains additional debug code.
Release version is compiled with more compiler optimisations.

 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      11-07-2006
(E-Mail Removed) wrote:

> I test a stl sort function in vs2005 and find the efficiency of debug
> to release version is about 1000:1, it suprise me and I'm curious what
> cause it.


Your question is off-topic here. This newsgroup is only about the C++
language, not any specific compilers or other programming utilities. It's
better to ask in a newsgroup about "vs2005".
Having that said, optimizations are probably disabled in debug mode. Some
optimizations make debugging a lot harder, so they are only enabled in
release mode.

 
Reply With Quote
 
Ivan Vecerina
Guest
Posts: n/a
 
      11-07-2006
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
:I test a stl sort function in vs2005 and find the efficiency of debug
: to release version is about 1000:1, it suprise me and I'm curious what
: cause it.

In debug mode, some standard library implementations (including the
one provided with VS2005) go to great lengths in making rendundant
checks. For example, each container might internally be keeping
a list of all iterators that point into it. And whenever an operation
on the container could invalidate iterators, all iterators will be
marked as invalid, to be able to report such diagnostics. As a result,
some operations are slowed down by orders of magnitude.

Defining some macros may allow you to disable these features in
debug mode (as well). This would allow you to suppress this
library-caused performance penalty.

[ Note that VS2005 also has some (lighter) library checks enabled
in release builds as well by default. They can explicitly
be disabled as well -- check your documentation if you need this. ]

hth -Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <> http://www.brainbench.com

 
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: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
switching between release and debug version Stefan Landgraf ASP .Net 2 10-01-2004 07:44 PM



Advertisments