High audio CPU usage running Release from debugger

I checked my project settings and I have all optimizations turned on. When I run the Release build of my audio application from the MSVC debugger, I get CPU spikes during playback and things generally run poorly.

If I run the .exe directly from Explorer, it is smooth sailing, almost no CPU usage whatsoever (I’m using the CPU meter built into the audio device class).

I already set _NO_DEBUG_HEAP=1 for the environment of the Release build.

Any ideas? This is a little bit frustrating…

not again :wink: Surely, you may can deactivate all debugging functionality to speed up things, but than, why you run a debugger anyway?, just start without debugger (ctrl-F5)

I have to run the Release build of my app in the debugger so I can debug and observe the application’s behavior while I have a low latency, high sample rate audio output device selected. The Debug version gets buffer underruns pretty quickly.

So I am in a bit of a bad situation here…I can’t use the debugger on my Release build!

Depending on what you need from ‘debug and observe’, you could hardcode debug breakpoints (int 3) directly into your code… this way you can run your release code, without the debugger attached, and get the debugger to load at those points where you’ve put the int 3.

You know DebugView software, right ? :wink:

I think I figured it out.

My application relies heavily on exceptions to interrupt its threads (i’m using boost::thread). I believe MSVC hooks and gets called for every exception, regardless of whether you have them displayed in the Output window or not (I turned mine off since there were so many).