由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - gprof和STL的问题
相关主题
大家都用什么工具来profile C/C++程序急问:大家一般都用什么profiling工具和memory leak的监测工
UNIX下的gprof command怎么用啊?[合集] 急问:大家一般都用什么profiling工具和memory leak的监
C++ Profilercode profiling 的问题
A C++ STL question怎么样profile C++ code最好?
问一个有关C++里面list的问题。STL感觉实在太变态了
如何取一个list的第i个elementc++ template question:
[合集] 关于C++ STL的list的一个问题c++ interview: iterator 和 pointer区别?
C++11里list迭代器判空仍然知道具体的list对象吗?C++ vector 一边遍历一边删
相关话题的讨论汇总
话题: gprof话题: list话题: iterator话题: stl话题: std
进入Programming版参与讨论
1 (共1页)
o*******7
发帖数: 13
1
用gprof做performance test,总是print出一堆iterator(如下)。怎么样才能让gprof
不去profile STL那部分的code呢?
=============
The flat profile of an analysed program begins with the
following entries:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
32.05 3.25 3.25 1037 0.00 0.00
std::_List_iterator_base::_List_iterator_base(std::_List_node_base*)
15.48 4.82 1.57 1 1.57 1.57
std::_L
t****t
发帖数: 6806
2
为什么不profile,STL不是code?
出现得多了正说明你STL用得多.想法减少凋用次数.
另外你不开-O2的?

gprof

【在 o*******7 的大作中提到】
: 用gprof做performance test,总是print出一堆iterator(如下)。怎么样才能让gprof
: 不去profile STL那部分的code呢?
: =============
: The flat profile of an analysed program begins with the
: following entries:
: Each sample counts as 0.01 seconds.
: % cumulative self self total
: time seconds seconds calls s/call s/call name
: 32.05 3.25 3.25 1037 0.00 0.00
: std::_List_iterator_base::_List_iterator_base(std::_List_node_base*)

h****e
发帖数: 2125
3
不想看的话可以用editor把iterator部分的print out都去掉,不profile是不对地。

gprof

【在 o*******7 的大作中提到】
: 用gprof做performance test,总是print出一堆iterator(如下)。怎么样才能让gprof
: 不去profile STL那部分的code呢?
: =============
: The flat profile of an analysed program begins with the
: following entries:
: Each sample counts as 0.01 seconds.
: % cumulative self self total
: time seconds seconds calls s/call s/call name
: 32.05 3.25 3.25 1037 0.00 0.00
: std::_List_iterator_base::_List_iterator_base(std::_List_node_base*)

o*******7
发帖数: 13
4
啊,你怎么看出来没开 -O2的? 其实贴出来的结果并不是我的结果,是从这里转过来
的:
http://osdir.com/ml/gnu.utils/2006-08/msg00003.html

【在 t****t 的大作中提到】
: 为什么不profile,STL不是code?
: 出现得多了正说明你STL用得多.想法减少凋用次数.
: 另外你不开-O2的?
:
: gprof

o*******7
发帖数: 13
5
这样去掉是不行的吧? 我是想把iterator用的时间放到每一个调用iterator的function
里去。这样我就知道每个我自己写的function到底被调用了多少次,用了多少时间。

【在 h****e 的大作中提到】
: 不想看的话可以用editor把iterator部分的print out都去掉,不profile是不对地。
:
: gprof

h****e
发帖数: 2125
6
那你研究研究gprof把,好一点的profiler都有call graph功能。

function

【在 o*******7 的大作中提到】
: 这样去掉是不行的吧? 我是想把iterator用的时间放到每一个调用iterator的function
: 里去。这样我就知道每个我自己写的function到底被调用了多少次,用了多少时间。

1 (共1页)
进入Programming版参与讨论
相关主题
C++ vector 一边遍历一边删问一个有关C++里面list的问题。
stl的一个问题如何取一个list的第i个element
std::list::iterator question[合集] 关于C++ STL的list的一个问题
interview questionsC++11里list迭代器判空仍然知道具体的list对象吗?
大家都用什么工具来profile C/C++程序急问:大家一般都用什么profiling工具和memory leak的监测工
UNIX下的gprof command怎么用啊?[合集] 急问:大家一般都用什么profiling工具和memory leak的监
C++ Profilercode profiling 的问题
A C++ STL question怎么样profile C++ code最好?
相关话题的讨论汇总
话题: gprof话题: list话题: iterator话题: stl话题: std