性能评测工具 :gprof 的使用
来源:互联网 发布:linux权限不够怎么办 编辑:程序博客网 时间:2024/05/18 03:37
由于环境是WIN, 就下了MINGW
设置好环境变量后,直接编译
gcc main.cpp -pg -lstdc++
得到a.exe gprof -b a.exe gmon.out >report.txt
Gprof 产生的信息解释:
%time
Cumulative
seconds
Self
Seconds
Calls
Self
TS/call
Total
TS/call
name
该函数消耗时间占程序所有时间百分比
程序的累积执行时间
(只是包括gprof能够监控到的函数)
该函数本身执行时间
(所有被调用次数的合共时间)
函数被调用次数
函数平均执行时间
(不包括被调用时间)
(函数的单次执行时间)
函数平均执行时间
(包括被调用时间)
(函数的单次执行时间)
函数名
测试程序:
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total time seconds seconds calls s/call s/call name
24.60 5.55 5.55 59950 0.00 0.00 Cut(std::vec ....
19.44 9.94 4.38 566119378 0.00 0.00 Intersection(Interval, Interval)
11.30 12.48 2.55 566147918 0.00 0.00 Interval::Interval(int, int)
可以看出 cut函数 占用了 24% 是 关键函数,如果要优化程序,可以从此处入手
- 性能评测工具 :gprof 的使用
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之gprof
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- Linux性能评测工具之一:gprof篇
- 【转载】Linux性能评测工具之一:gprof篇
- Python项目部署的三大神器
- java-获取控制台输入(传统)
- 菱形虚拟继承详解
- netty学习笔记(5)_心跳机制
- react-native-modal-alert
- 性能评测工具 :gprof 的使用
- ssh with multiple redirect port tunnel
- 如何用消息系统避免分布式事务?
- java8新特性整理
- 几种数据库的db.properties的配置
- poj1018 Communication System
- Python-MongoDB连接搭建(二):Python连接MongoDB
- 【算法】字符串模式匹配Sunday算法
- Android Gson框架使用