[Haskell-cafe] oddity with profiling
Matthias Fischmann
fis at wiwi.hu-berlin.de
Mon Oct 2 17:01:59 EDT 2006
hi,
i have been staring at a strange profile for a while now, and was
wondering whether anybody could give me a hint. (using ghc.6.4. i
know i should upgrade, but has the profiler changed after that in
particular?)
almost all time / memory costs occurs in a CAF cost center. as far as
i understand, this means that the evaluation only takes place once
each time i run the program, and doesn't depend on the input.
Q1. why should one distinguish time spent in top-level constants
from time spent in functions? (my program is basically a top-level
constant that calls a function i am trying to understand with
constant toy arguments.)
curiously, the costs inherited by the CAF cost center and caused
elsewhere do not show anywhere else, although i am pretty sure the
call stack doesn't leave my code for another few levels.
Q2. how can i learn which parts of my code causes the CAF cost
centers to bloat? and what does it mean if the 100% inherited
costs do not show in any other item in the cost center stack in my
profile?
user manual yields further confusion:
| The cost of evaluating any expression in your program is attributed to
| a cost-centre stack using the following rules:
|
| * If the expression is part of the one-off costs of evaluating the
| enclosing top-level definition, then costs are attributed to the stack
| of lexically enclosing SCC annotations on top of the special CAF
| cost-centre.
how can an expression be part of the one-off cost of anything? does
the second part mean that the SCC annotations are on top of the
special CAF cost-center? which is the special CAF cost-center? what
does being on top of that mean?
sorry, maybe i am just tired... :-/
| * Otherwise, costs are attributed to the stack of
| lexically-enclosing SCC annotations, appended to the cost-centre stack
| in effect at the call site of the current top-level
| definition[7]. Notice that this is a recursive definition.
|
| * Time spent in foreign code (see Chapter 8, Foreign function
| interface (FFI) ) is always attributed to the cost centre in force at
| the Haskell call-site of the foreign function.
thanks,
matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20061002/6b5cbdad/attachment.bin
More information about the Haskell-Cafe
mailing list