[Haskell-cafe] Re: Analysing Haskell Program

Thomas Tuegel ttuegel at gmail.com
Fri Aug 1 18:52:57 EDT 2008


Thomas Davie <tom.davie <at> gmail.com> writes:
> On 1 Aug 2008, at 16:01, Roberto D'Aprile wrote:
> 
> > Hello to everybody
> >
> > I'm using haskell for some research work and now i need to evaluate  
> > the performance of some simple haskell programs in particular  
> > information on the  like, CPU cycles, bus usage, memory access and  
> > so on; so i wish to know if there is a way to compile haskell  
> > programms so they can be used with simplescalar or if there is  
> > another tool which i can use.
> 
> I've been getting some useful information by compiling with -fvia-C  
> and then using dtrace to look at what's going on.

I've been using the basic profiling features built into GHC for profiling. 
There are more details in the documentation, but basically you can build a
binary with profiling support with the options "-prof -auto-all" to GHC.  Then,
there are some RTS options at runtime that control the profiling output.  I
often use "+RTS -p -hc -sstderr".  These options produce, respectively, a 1) a
profile of time spent in and memory used by each function call, 2) a graph of
when in time memory was allocated and 3) basic garbage collecting statistics,
including how much time was "wasted" on garbage collection overall.

I realize these options don't produce very detailed output, but I find they give
a pretty good overview of what's going on.  I believe there are also more
detailed output options documented in the GHC user manual.



More information about the Haskell-Cafe mailing list