Using gcc on Ubuntu, should there be a (speed) performance difference if compiling the code with:
gcc -O3 prog.c
or:
gcc -O3 -g prog.c
IOW, does the insertion of debug information slows down the executable?
Using gcc on Ubuntu, should there be a (speed) performance difference if compiling the code with:
gcc -O3 prog.c
or:
gcc -O3 -g prog.c
IOW, does the insertion of debug information slows down the executable?
Yes, it can slow down the executable a bit. Also, stack and control flow-related optimizations will be disabled when using -g.
See this SO post as a possible duplicate: How Does The Debugging Option -g Change the Binary Executable?