Jump to content

  • Log In with Google      Sign In   
  • Create Account


Visual Studio can't debug performance bottleneck


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 simpler   Members   -  Reputation: 912

Like
0Likes
Like

Posted 19 October 2012 - 04:48 AM

I'm currently working on adding a GUI to a project and I'm having some problems with the FPS when rendering it. I'm having a hard time finding the bottleneck due to these circumstances:
  • When I run in debug mode the fps drops to around 14 when the GUI gets displayed. The thing is when I run the 'Performance Analyzis' tool to find the bottleneck the fps only goes down to around 140
  • When I run in release mode the fps also drops to around 14, but when I run the generated .exe file seperately the fps stays at 500

I thought that when running the analyzer things go slower but in this case the program runs 10x faster. Doesn't the analyzer use the exact same settings as when running in normal debug mode? And how can there be such a big difference between running the .exe file and running in release mode?

Im using GWEN as GUI library and a custom DirectX 11 renderer for it. To draw fonts I use FW1FontWrapper. Also I'm using Visual Studio 11 Beta.

Does anyone recognize this behavior?

Edited by simpler, 19 October 2012 - 04:51 AM.


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6691

Like
3Likes
Like

Posted 19 October 2012 - 04:51 AM

big difference between running the .exe file and running in release mode?

Edit: Do you start the release mode pressing F5 ? Then you start your application with VS hooked up in debug mode.
When this happens, as far as I know, VS does some time consuming memory checking, even in release mode.

To clear it up:
compile in debug mode: disable optimization, add some debug code to your compiled code
compile in release mode: enable optimizations
F5: start VS in debug mode, it will hook up and check your application
Ctrl+F5: start your application without hooking up

Edited by Ashaman73, 19 October 2012 - 05:09 AM.


#3 simpler   Members   -  Reputation: 912

Like
0Likes
Like

Posted 19 October 2012 - 06:07 AM

Thanks for the fast answer! Yes I start the release mode with F5. I tried with Ctrl+F5 and got the same result as running the .exe file, that explains it.

I also tried starting the debug mode with Ctrl+F5 and got the same performance as running the performance analyzer. It seems like the analyzer runs without VS hooked up, is there any way to run it with VS hooked?

#4 Anon Mike   Members   -  Reputation: 1098

Like
1Likes
Like

Posted 19 October 2012 - 01:47 PM

This is actually a Windows internal thing, not VC specifically. If a process starts up with a debugger attached then the Windows heap manager will put itself into debug mode.

To work around it, start your app without debugging (ctrl-F5) and then attach VC to the process after it starts.
-Mike

#5 adeyblue   Members   -  Reputation: 518

Like
2Likes
Like

Posted 19 October 2012 - 04:14 PM

You can also set the _NO_DEBUG_HEAP environment variable to a non-zero value to stop it from occuring. You used to be able to set it from the Environment part of Project Properties->Configuration->Debugging but that was in VS2008, it may have changed in more recent versions.

#6 simpler   Members   -  Reputation: 912

Like
0Likes
Like

Posted 20 October 2012 - 02:49 AM

Setting _NO_DEBUG_HEAP to a non-zero value did the trick! But I guess that by doing that I miss some important debug information?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS