Profiling nnrpd
Jeffrey M. Vinocur
jeff at litech.org
Fri Nov 29 06:33:34 UTC 2002
Ok, I've got some preliminary results from gprof for nnrpd. I compiled
with `make profiled PROF='-pg -a -O0'` (need the -O0 because the default
-O2 is introducing an inexplicable segfault; perhaps I'll try -O1
tomorrow) which may affect the results, so keep that in mind.
I ran nnrpd directly (i.e., input from stdin), did a LIST and then a bunch
of GROUP and XOVER 1- for the first half-dozen high-traffic groups that
came to mind. I'm finding the flat profile part of gprof most useful
(since the control flow is generally pretty clear, the analysis of how
many times something was executed isn't too interesting, but you're
welcome to it if you want it):
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
82.35 0.14 0.14 90023 1.56 1.56 tdx_search
11.76 0.16 0.02 7 2857.14 24285.71 CMDxover
5.88 0.17 0.01 90023 0.11 1.67 tradindexed_search
0.00 0.17 0.00 90023 0.00 1.67 OVsearch
0.00 0.17 0.00 90023 0.00 0.00 SendIOv
0.00 0.17 0.00 8594 0.00 0.00 uwildmat
[...]
We can also get a more finely-grained analysis for each of the
substantial functions with `gprof -l -ptradindexed_search -ptdx_search
-pCMDxover`, although I'm not sure I entirely understand it. Mostly
because I'm not sure what criteria it uses to decide which lines are
broken out separately and what part of the program belongs to each of the
rows in the output table (below).
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name
38.24 0.07 0.07 tdx_search (tdx-data.c:413 @ 80a5270)
14.71 0.09 0.03 tdx_search (tdx-data.c:441 @ 80a53e6)
14.71 0.12 0.03 tdx_search (tdx-data.c:442 @ 80a53fa)
5.88 0.12 0.01 CMDxover (article.c:978 @ 806512c)
5.88 0.14 0.01 CMDxover (article.c:983 @ 80651a8)
5.88 0.14 0.01 tdx_search (tdx-data.c:405 @ 80a51a9)
5.88 0.15 0.01 tdx_search (tdx-data.c:412 @ 80a5244)
5.88 0.17 0.01 tradindexed_search (tradindexed.c:277 @ 8098f16)
2.94 0.17 0.01 tdx_search (tdx-data.c:414 @ 80a527f)
0.00 0.17 0.00 90023 0.00 0.00 tdx_search (tdx-data.c:401 @ 80a5180)
0.00 0.17 0.00 90023 0.00 0.00 tradindexed_search (tradindexed.c:261 @ 8098e28)
0.00 0.17 0.00 7 0.00 0.00 CMDxover (article.c:917 @ 8064e40)
--
Jeffrey M. Vinocur
jeff at litech.org
More information about the inn-workers
mailing list