Creating threads slows down the debugger


I would just like to point out that if you have the Visual Studio debugger attached to your app (Debug or Release target, doesn’t matter), not only will throwing exceptions slow down the app, but so will creating and destroying threads. The reason is because the debugger intercepts these system calls so it can keep track of them.

In my app I sometimes get audio glitches when I run with a debugger attached, when I create new threads, and especially on exit when I tell a bunch of threads to terminate before closing the audio device. These glitches go away when a debugger is not attached.

The moral of the story is that having the Visual Studio debugger attached, even when running a Release build, can cause the application to perform differently.