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

测试运行时间

 

 

posted @ 2012-02-11 18:56  changliwei  阅读(607)  评论(0)    收藏  举报