If it's not an OutputDebugString
, or if piles and heaps of breakpoints slow things down, try the following:
Windows debugging heap - your process gets a lot of debugging if it runs under the debugger, no questions asked. To disable this when working under the Visual Studio debugger, go to the project properties debug page and add _NO_DEBUG_HEAP=1
to the environment.
(The Windows debugging heap is a separate thing from the CRT debugging heap. In your assembly, you will also get Windows debugging if it runs under the debugger.)
The program loads many DLLs that have characters. When the DLL loads, Visual Studio tries to find characters for it. If there are symbols, this may take some time. There is not much that can be done there, except to change the order of your program so that it loads DLL files less often.
Check for any calls to IsDebuggerPresent
- this can lead to arbitrary differences between running in and out of the debugger.
(As a final sentence with sentences - I would also be suspicious that exceptions (whether C ++ or structured) may be a bit more active when the process is debugging. Therefore, if your programs throw a lot, it might be a little slower when debugging.)
user976631
source share