2 % Included by profiling.lit
5 When you run your profiled program with the \tr{-p} RTS option
6 \index{\tr{-p<sort> RTS option (profiling)}}, you get the following
7 information about your ``cost centres'':
10 %-------------------------------------------------------------
11 \item[\tr{COST CENTRE}:] The cost-centre's name.
12 %-------------------------------------------------------------
14 The module associated with the cost-centre;
15 important mostly if you have identically-named cost-centres in
17 %-------------------------------------------------------------
19 How many times this cost-centre was entered; think
20 of it as ``I got to the \tr{_scc_} construct this many times...''
21 %-------------------------------------------------------------
23 What part of the time was spent in this cost-centre (see also ``ticks,''
25 %-------------------------------------------------------------
27 What part of the memory allocation was done in this cost-centre
28 (see also ``bytes,'' below).
29 %-------------------------------------------------------------
31 How many times this cost-centre ``passed control'' to an inner
32 cost-centre; for example, \tr{scc=4} plus \tr{subscc=8} means
33 ``This \tr{_scc_} was entered four times, but went out to
34 other \tr{_scc_s} eight times.''
35 %-------------------------------------------------------------
37 How many CAFs this cost centre evaluated.
38 %-------------------------------------------------------------
40 How many dictionaries this cost centre evaluated.
43 In addition you can use the \tr{-P} RTS option \index{\tr{-P<sort> RTS
44 option (profiling)}} to get the following additional information:
46 %-------------------------------------------------------------
47 \item[\tr{ticks}:] The raw number of time ``ticks'' which were
48 attributed to this cost-centre; from this, we get the \tr{%time}
49 figure mentioned above.
50 %-------------------------------------------------------------
51 \item[\tr{bytes}:] Number of bytes allocated in the heap while in
52 this cost-centre; again, this is the raw number from which we
53 get the \tr{%alloc} figure mentioned above.
56 Finally if you built your program with \tr{-prof-details}
57 \index{\tr{-prof-details option}} the \tr{-P} RTS option will also
58 produce the following information:
60 %-------------------------------------------------------------
62 How many heap objects were allocated; these objects may be of varying
63 size. If you divide the number of bytes (mentioned below) by this
64 number of ``closures'', then you will get the average object size.
65 (Not too interesting, but still...)
66 %-------------------------------------------------------------
68 How many times we entered (evaluated) a thunk---an unevaluated
69 object in the heap---while we were in this cost-centre.
70 %-------------------------------------------------------------
72 How many times we entered (evaluated) a function while we we in this
73 cost-centre. (In Haskell, functions are first-class values and may be
74 passed as arguments, returned as results, evaluated, and generally
75 manipulated just like data values)
76 %-------------------------------------------------------------
78 How many times we entered (evaluated) a partial application (PAP), i.e.,
79 a function applied to fewer arguments than it needs. For example, \tr{Int}
80 addition applied to one argument would be a PAP. A PAP is really
81 just a particular form for a function.