怎么看在c优化code [英] how to see the optimized code in c

查看:131
本文介绍了怎么看在c优化code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用分析器检查优化,可执行文件和时间的大小承担执行。

I can examine the optimization using profiler, size of the executable file and time to take for the execution.

我可以得到最优化的结果。
但我有这些问题,

I can get the result of the optimization. But I have these questions,


  • 如何获得优化的C code。

  • 哪些用C的算法或方法来优化code。

先谢谢了。

推荐答案

您可以使用选项 -fdump树优化用gcc得到优化的想法。
你会得到一个优化的文件。你不能运行code,但使用,你可以得到最优化的想法。不要忘了包括 -O2 -O3 或一些其他的水平。

you can get an idea of optimization using the option -fdump-tree-optimized with gcc . and you'll get an optimised file. you cannot run the code but using that you can get an idea of optimization . dont forget to include -O2 or -O3 or some other level.

这篇关于怎么看在c优化code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆