views:

39

answers:

3

Hi, I have a chess game I have created in Visual Studio 2008.

It runs very well when I am debugging, but now I have finished and built the program, it lags a bit and I'm finding it a bit annoying as it was running so well in when creating/debugging mode...

Can anyone shed some light on this for me, or has any body got any little tricks that might help :)

Thanks

John McMohan

A: 

The only way to know is to profile your code and see where it's spending most of its time.

BTW, your title doesn't make sense -- a C++ application doesn't run at all unless it's built into an executable.

Shaggy Frog
A: 

http://msdn.microsoft.com/en-us/magazine/cc337887.aspx

selbie
Only If he has VS team edition (i.e. $$$$)
C Johnson
+1  A: 
  1. Look for conditionally compiled code that says #ifndef _DEBUG
  2. Start logging different application states. That is start logging how long certain functions take to execute. Print the time out to the debug window. Find problems and repeat until you find a section of code that is problematic. BTW: You can still capture debug output even in release build configurations by using Debug View from SysInternals.com
  3. Run it through a performance analyzer like V-Tune, or if you have visual studio Team Edition, you can use the performance analyzer that comes with the team suite of tools. (Which is an awesome set of tools by the way).
  4. Check if your build settings again to make sure you didn't accidently leave some wierd option on or off (that would mess with your build). For instance linking to the debug libraries in release build configuration.
C Johnson