Cost Centre MAIN

Simon Marlow marlowsd at
Tue Sep 21 05:26:09 EDT 2010

On 19/09/2010 13:11, Stefan Wehr wrote:
> Hi all,
> I'm profiling a Haskell program and now getting that the program
> spents 56% of its individual time in the cost centre MAIN (note the
> capital letters).
> I searched the documentation for this cost centre, with no success. In
> all profiling results so far, the individual time spent in MAIN was
> always 0%.

The profiler constructs a tree of cost centres representing the lexical 
call structure of your program.  The root of this tree is the special 
cost centre "MAIN", which will collect any costs that are not otherwise 
attributed to any other cost centre.

Usually if you get lots of costs attributed to "MAIN", then you don't 
have any cost centres; you should either compile with -auto-all, or add 
explicit cost centres yourself with {-# SCC "..." #-}.


More information about the Glasgow-haskell-users mailing list