Debugging is very slow when attached to DAW on Windows using CLion

Hi,
I am using CLion as my IDE, when in Windows running debug and attached to the DAW, both the DAW and my plugin are very slow, many times slower than when running the Release built.
It is so slow that it makes it very hard to work with.

Does this have to do with Debugging optimization? and if yes, how do i turn it on?
In this post it describes how to turn optimization on in a VS project

Any advice on how to speed up the debugging when attached to DAW?
The computer is quite fast, intel i7 10th gen.

Many thanks!

The debugger should not effect the speed of the code, and thus the DAW should not be running more slowly during debugging. But, your code, the plugin, will run more slowly due to code generation not being optimized, which is what your link refers to. I don’t know the answer to your problem, but I wanted to point out that detail.

Give the “RelWithDebugInfo” option a try - click + in the CMake section of Build, Execution, Deployment pane in Prefs pane until you get past the Debug and Release defaults you get the first you times you click it.

Also try generating a Visual Studio project using a CMake generator to see if your experience is different over there or not.

RelWithDebugInfo is so much faster! Very close to the Release.
So, in theory i should be able to debug with RelWithDebugInfo?
I found this
https://cmake.org/pipermail/cmake/2001-October/002479.html

Is it possible and would it offer any benefit to use compiler options /O2 (Maximize Speed) in Debug?

Many thanks!

It’s possible your Debugger won’t be line-for-line accurate in RelWithDebugInfo mode, but you should be able to get by in many/most cases. /O2 will have a worsening effect in this case, often to the point where debugging is impossible (equivalent of -o3 or -ofast in non-Windows OS)

Many thanks for all the advise Kcoul and cpr2323!
RelwithDebInfo works great for my debugging purposes up to now.
It is so much faster to debug now!