Version 3 (modified by erikd, 7 years ago)


Memory and CPU Usage Profiling

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

I (Erik) keep a separate branch specifically set up for profiling. That branch was 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 is as:

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

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

hp2ps -c ddc.hp