标签: performance optimization gcc
在Ubuntu上使用gcc,如果用以下代码编译代码,应该有(速度)性能差异:
gcc -O3 prog.c
或:
gcc -O3 -g prog.c
IOW,插入调试信息是否会降低可执行文件的速度?
答案 0 :(得分:3)
是的,它可以减慢可执行文件的速度。此外,使用-g。
将此SO帖子视为可能的副本:How Does The Debugging Option -g Change the Binary Executable?