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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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?