Use gprof to visualize code running time
来源:互联网 发布:jd抢购软件 编辑:程序博客网 时间:2024/06/05 22:43
Step 1
Install requirements:
- gprof
- graphviz
- grpof2dot
Step 2
Add -pg to gcc/g++ flag, both when compiling and linking, like below:
g++ -pg -I . -o fun.o fun.cppg++ -pg -I . -o main.o main.cppg++ -pg -o main main.o fun.o -L/usr/local/lib -lboost_system
Step 3
./main
Run the execute file. And then you may find gmon.out file in the folder containing exe.
Step 4
gprof main gmon.out | gprof2dot | dot -Tpng -o output.png && eog output.png
You can find a picture like this:
Step 5
Another endless journey of optimization begins.
0 0
- Use gprof to visualize code running time
- How to use gprof
- How to use time...
- use code to generate Silverlight Controls at run time, and serialize the control into XAML file
- Time of check to time of use
- How to get linux running time
- One way to improve running time
- Use code to approve SPListItem
- How To Use the C Run-Time
- Use shell to monitor long time query
- Use explicit instantiation to minimize compile time and link time;
- Use SVN to manage your code
- use code to add Navigation----iphone
- How to use ArcGIS samples for help running the sample
- GPROF Tutorial – How to use Linux GNU GCC Profiling Tool
- How to visualize disk usage on Linux
- A way to visualize mip levels
- Use profile to limit session's idle time
- 始终在路上--- 工作小结
- 将字符串格式化后输出
- JZOJ 4919.【NOIP2017提高组模拟12.10】神炎皇
- 使用Http Head方法获取文件长度
- Android Studio打开Android Device Monitor中的DDMS没有内容显示
- Use gprof to visualize code running time
- vlc延迟流和桥接流输出功能等
- Laravel 服务容器实例教程 —— 深入理解控制反转(IoC)和依赖注入(DI)
- Lwip ARP分析(1)
- System.out.println(5.00 - 4.90);结果分析
- 将字符串插入到另一个字符串的指定位置
- 【codevs2822】 爱在心中 tarjan+统计点的个数
- dB的意义
- 关于Java -jar参数的使用心得