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 get 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/

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.

make cleanWar
bin/ddc +RTS -hc -p -K100M -RTS --make test/ddc-main/60-Lite/99-Defib/03-Reverse/Main.dcl

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

Last modified 5 years ago Last modified on Dec 5, 2012, 12:37:27 PM