Visual Studio application running extremely slow with debug

Viewed 18373

I have a native C++ program which runs more than 20 times slower when started with Debug (F5), but runs at normal speed when using start without debug (Ctrl + F5).

It does not matter whether I use a debug or release build. Also if I use WinDbg the program is a magnitude slower.

Is there some setting I did choose wrong or something?

7 Answers

For me the difference in performance between debug mode and release mode is about a factor 40. After some digging, it appears several things contribute to the difference in performance, but there is one compiler option that quadruples my debug performance almost for free.

Namely, changing /ZI into /Zi. For a description, see the MSDN page.

I don't use the edit and continue feature anyway.

Related