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.
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:
- Enable some optimizations in Debug mode like
- Disable iterator debugging
- Disable debug heap
- Use Release mode and only enable debugging in specific files