profiling experience

Kirsten Chevalier catamorphism at
Wed Dec 6 10:21:23 EST 2006

On 12/6/06, Serge D. Mechveliani <mechvel at> wrote:
> What may consitute this strange CAF cost of 96% ?
> Kirsten Chevalier <catamorphism at>
> wrote
> > I didn't look at your code all that carefully, but did you build the
> > GHC libraries with "-prof -auto-all"? (Not just "-prof".) If you don't
> > build the libraries with "-auto-all", then cost centres won't get
> > inserted for library functions, and if it's really a standard library
> > function that's taking all of that time, the profiling report won't
> > indicate that.
> I made ghc-6.6 from the official source in a standard way:
>   ./configure ...;  make;  make install
> Does this presume that this also generates the .p.o GHC library versions
> for -prof -auto-all ?

No; you must have built the profiling libraries (i.e., building the
libraries with -prof), otherwise you wouldn't have been able to
compile your code for profiling. But, building the profiling libraries
in the standard way doesn't add "-auto-all" to the compile flags. So
if you want to build the libraries with "-auto-all", do:
make EXTRA_HC_OPTS=-auto-all

but be careful! As I said in my previous message, adding cost centres
disables some optimizations, so the profiling results you get from
this may not be accurate with respect to what would happen if you ran
your code after building it with -O and no profiling.


Kirsten Chevalier* chevalier at *Often in error, never in doubt
"I cannot remember a time when I did not take it as understood that everybody
has at least two, if not twenty-two, sides to him."--Robertson Davies

More information about the Glasgow-haskell-users mailing list