I am writing a program that attempts to speed up a Top K filtering alogrithm using SSE and AVX SIMD instructions. I am compiling my program using icc with the flags -o3, -msse3, and -lrt, and the run-time comes out to ~30ms. However, when I put a -g flag at the end to use vtune or gdb, the time the program takes to run jumps to ~100ms.
Could someone explain why this is possibly happening? I am very confused as to why -g would change the compilation of a program.