Time profiling question.

Simon Marlow simonmar at microsoft.com
Wed Nov 26 12:59:22 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.

Sounds like it might be a bug.  There are known problems in the
attributions of costs in the profiling system, though: in particular
some transformations in the simplifier can affect the cost attribution.
This might be what's happening, but it would be nice to see an example
so we can investigate.  Any chance you can boil down your code?

Cheers,
	Simon



More information about the Glasgow-haskell-users mailing list