Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VS2008 much slower than VS2003

4 views
Skip to first unread message

terry

unread,
Jun 28, 2009, 4:53:15 PM6/28/09
to
Hi, can anyone help. I have some very intensive code (C++) which pushed huge
numbers of small std::map classes around, iterates across them etc. making
and deleting them on the way.

I have just ported the code to VS2008 from 2003 + Intel Compiler.

Unfortunately, the code runs very slowly! Roughly 2008 = 28 secs; 2008 +
Intel = 25secs ; 2003 = 14 secs ; VS2003 + Intel = 12 seconds.

Another piece of code using the same base library has slowed down by factors
of 100s but I have not looked in detail at it so there might be simpler
explanations.

Not completely clear where the bottlenecks are so it would be good to have
hints. Looks as if it migth be in the STL.

Terry


Bo Persson

unread,
Jun 29, 2009, 1:47:56 PM6/29/09
to

Have you checked(!) the information on Checked Iterators, meaning some
debugging is enabled by default even in release builds?

http://msdn.microsoft.com/en-us/library/aa985965.aspx

Bo Persson


terry

unread,
Jun 29, 2009, 7:05:14 PM6/29/09
to

"Bo Persson" <b...@gmb.dk> wrote in message
news:7asd1vF...@mid.individual.net...

Thanks - these changes and compiler switches have made the difference.


Stephen Howe

unread,
Jun 30, 2009, 9:06:02 AM6/30/09
to
On Sun, 28 Jun 2009 21:53:15 +0100, "terry" <ne...@lyonstech.net>
wrote:

>Hi, can anyone help. I have some very intensive code (C++) which pushed huge
>numbers of small std::map classes around, iterates across them etc. making
>and deleting them on the way.

Then consider using a vector with reserve (possibly sorted). The
overhead of insertion/deletion with a map is considerable, more so
than what vector provides

Stephen

Scot T Brennecke

unread,
Jul 5, 2009, 3:55:52 PM7/5/09
to Bo Persson

> Bo Persson

There's a bug in the conversion wizard when you upgrade from older
versions that might have bitten you:

Converting C++ Project From 2005 to 2008 Invisibly Disables Optimization
For Release Build | Microsoft Connect:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=383764&wa=wsignin1.0

Stephan T. Lavavej [MSFT]

unread,
Jul 10, 2009, 4:01:31 PM7/10/09
to
1. Make sure that your project is still being built with /O2 . There's some
bug (whose details I forget, as I don't build with the IDE) where upgrading
projects drops their optimization settings on the floor. "Oops."

2. Make sure that you're examining release performance, not debug
performance (sounds obvious, but people make this mistake far too often).

3. Try defining _SECURE_SCL to 0 project-wide (the easiest way to do this is
to compile all of your objects AND STATIC LIBRARIES with /D_SECURE_SCL=0 ).
VS 2005 and VS 2008 added _SECURE_SCL, which is enabled by default. It
provides a last line of defense against attackers trying to exploit buggy
STL-using programs, at the cost of performance.

Stephan T. Lavavej
Visual C++ Libraries Developer

"terry" <ne...@lyonstech.net> wrote in message
news:ZfOdnSKQjOqmRdrX...@eclipse.net.uk...

0 new messages