Performance with different compilers

Started by
20 comments, last by Aressera 12 years, 9 months ago
Hello gd people,
i had my c++/opengl project running fine on CodeBlocks (with MINGW compiler). The debugger but was not so handly so i decided to move all the code in VS2010 Express edition.

The code is for the 99.9% the same. The 0.1% difference comes from stuff that compiles on CB and not in VS and i had to change.

My program is a win32 project. In the strarting it has to do lot of calcs because it has to build a mesh representing an image. The mesh is a complex object containing members like stl Vectors of pointers to vertices, edges, faces etc...

Why the hell when i run the program in VS it takes much longer respect to CB? Of course i run everything in release. Once the mesh is builded i cant notice any different in performance.
But at the start, before the first image appears in the drawning window, we speak of 1-2 seconds in CB versus 10-15 seconds in VS.
Might be express edition the problem?

Thanks fellows!
Riziero
Advertisement
By default, MSVC generates debug-safety code for STL containers (even in release builds), which makes iterating over them (and other operations) excessively slow.

In your projects properties, you want to add the definitions:
[font="'Courier New"]_SCL_SECURE_NO_WARNINGS[/font]
[font="'Courier New"]_SECURE_SCL=0[/font]
[s]Are you running a debug or release build when you measure those times?[/s]

Nevermind.

Are you running a debug or release build when you measure those times?


He did say he's running in Release when measuring the times.

I would go with Hodgmans suggestion.

[quote name='BitMaster' timestamp='1309950516' post='4831721']
Are you running a debug or release build when you measure those times?


He did say he's running in Release when measuring the times.

I would go with Hodgmans suggestion.
[/quote]

Thanks for fast reply.
I will try when i am back to homeand let you khnow :D
Thats pretty wierd. Without even adding that setting, my speed in VC2010 is about 3x codeblocks when both are in the default release modes

By default, MSVC generates debug-safety code for STL containers (even in release builds), which makes iterating over them (and other operations) excessively slow.

In your projects properties, you want to add the definitions:
[font="'Courier New"]_SCL_SECURE_NO_WARNINGS[/font]
[font="'Courier New"]_SECURE_SCL=0[/font]

Actually, that only applies to MSVC 2005 and 2008. In MSVC 2010 _SECURE_SCL is disabled by default in release builds. Also, _SCL_SECURE_NO_WARNINGS has no performance impact.
Try running your program through a profiler (such as AMD's CodeAnalyst) to get a better look under the hood.
How are you running your app? If from within the IDE make sure you use CTRL-F5 (start without debugging) as opposed to just F5 (Debug).

By default, MSVC generates debug-safety code for STL containers (even in release builds), which makes iterating over them (and other operations) excessively slow.

In your projects properties, you want to add the definitions:
[font="Courier New"]_SCL_SECURE_NO_WARNINGS[/font]
[font="Courier New"]_SECURE_SCL=0[/font]


How do you do this? Under which section?

This topic is closed to new replies.

Advertisement