Skip to content
Advertisement

c++ Windows debug performance is very slow vs linux

I have a Cmake OpenCV project. If I execute the same project under Windows in the debug configuration is the performance very bad and I place zero breakpoints. In the release modus, I get the same performance as on Linux.

Why is the performance better on Linux than on Windows? Can I fix the performance issue on window?

I use the compiler GCC on Linux and on Windows the VS compiler. On both OSs, I use Clion as IDE.

Advertisement

Answer

It is not uncommon to see 10..100+ slower performance between unoptimized and optimized code.

VC++ does more checks in Debug mode than GCC, which leads to easier debugging, but possibly slower code.

Some possible solutions:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement