Version 6 (modified by bens, 5 years ago)

--

Memory and CPU Usage Profiling

Much of the information on this page was gleaned from Chapter 25 of Real World Haskell.

It probably advisable to keep a separate branch specifically set up for profiling. That branch can just forked off a local ddc-head branch using:

darcs branch ddc-head ddc-profiling

After changing directory into the ddc-profiling branch I create a custom config in that branch by doing:

echo "BUILDFLAVOUR = devel_prof" > make/config-override.deps

The compiler can now be built using the make command.

Once we have the profiling version of the compiler built is a matter of running it on something appropriate. I usually choose the test program in test/90-Programs/Rover and run it as:

make cleanWar
bin/ddc +RTS -hc -p -K100M -RTS --make test/90-Programs/Rover/Main.ds

This generates a profile output file named ddc.hp which can be converted into a profile graph using:

hp2ps -c ddc.hp

to generate the Postscript file ddc.ps.