Time profiling question.

Alex Ferguson abf at cs.ucc.ie
Tue Nov 25 15:34:54 EST 2003


Let me ask this question in the abstract, lest I embarrass myself
publicly with my shoddy code:

Suppose I find that -p style profiling with -auto-all attributes the
majority of the cost of my program to a single function.  Naturally, I'd
like to refine this somewhat.  So I add additional cost centres as
follows:

f a1 ... an
   = e
   where
   d1 = {-# SCC "d1" #-} e1
   ...
   d1 = {-# SCC "dn" #-} e1

I find it's still attributing almost all of the cost to the original CC
(f), so I add another SCC, before the RHS.  And it _still_ attributes
the same amount to f, and effectively nothing to the body CC.

So my questions are firstly, can someone explain this;  and secondly, is
there a style of adding CCs that would be more informative in such
cases?  (Or if it comes down to it, transforming the code to be more
revelatory in that respect.)

Cheers,
Alex.


More information about the Glasgow-haskell-users mailing list