gcc优化编译性能对比
gcc 优化编译性能对比
gcc优化编译选项
-o0 缺省默认,不优化
-o1
-o2
-o3
-o...等等
代码
编译
root@clw:~/gcc# ls
mytest.c
root@clw:~/gcc# gcc -Wall mytest.c -o0 -o test0
root@clw:~/gcc# gcc -Wall mytest.c -o1 -o test1
root@clw:~/gcc# gcc -Wall mytest.c -o2 -o test2
root@clw:~/gcc# gcc -Wall mytest.c -o3 -o test3
root@clw:~/gcc# gcc -Wall mytest.c -o4 -o test4
测试运行时间
浙公网安备 33010602011771号