c++ - Why is running attached to the debugger so slow? -


what going on causes debug build slower attached debugger compared unattached? both same exe running.

edit: of answers concentrate on breakpoints. i'm still running mud without breakpoints, outputdebugstring, or in watch window. debug crt, runtime stack checks, , debug heap?

if isn't outputdebugstring or piles , piles of breakpoints slowing down, try these:

  • windows debug heap - process gets debug heap if running under debugger, no questions asked. disable when running under visual studio debugger, visit debugging page of project properties , add _no_debug_heap=1 environment.

    (the windows debug heap separate thing crt debug heap. release build windows debug heap too, if runs under debugger.)

  • the program loads lots of dlls have symbols. when dll loaded, visual studio tries find symbols it. if there symbols available, can take time. there's not can except rearrange program loads dlls less often.

  • check calls isdebuggerpresent - can introduce arbitrary differences between running in debugger , outside it.

(as final throwaway suggestion - suspicious exceptions (whether c++ or structured) might bit more involved when process being debugged. if programs throws lot, maybe bit slower when it's being debugged.)


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -