Running in debug mode can be incredibly slow in visual studio, and running in release mode will give you almost zero debugging options.
There are a few steps that allow you to get an in-between with decent speed and decent debugging:
- Click the little arrow next to the dropdown that let’s you choose Debug/Release mode
- Select “Configuration Manager”
- In the same row as your project, click “debug/relase” and select “new”
- Name it “Release-Dbg”, select “copy settings from … Release” and tick “Create solution configurations”
Half way there. now right click your project in solution explorer and go into the project properties (where you change compiler settings and similar stuff)
- Select “Release-Dbg” as configuration and “All platforms” as platform
- C++ > General: Change Debug Information Format to C7 compatible
- Linker > General: Enable Incremental Linking to NO
- Linker > Debugging: Generate Debug Info to YES
- Linker > Optimization: References to YES (/OPT:REF)
- Linker > Optimization: Enable COMDAT folding to YES (/OPT:ICF)
Congrats! You can now use “Relase-Dbg” to run your build. It will be speedy, and debuggable.
Instructions are mostly based on this Article: https://docs.microsoft.com/en-us/cpp/build/how-to-debug-a-release-build?view=vs-2019