[Haskell-cafe] ANN: hp2html, a tool for viewing GHC heap-profiles

Iavor Diatchki iavor.diatchki at gmail.com
Tue Feb 21 03:45:42 CET 2012


Hello,

I am happy to announce the availability of a little tool that I wrote while
I was doing some Haskell profiling.  It converts GHC's heap-profiles into
HTML, and renders them nicely using the flot library.  Its functionality is
similar to `hp2ps`.  I wrote it because I find the HTML output easier to
work with and, also, because it can cope with partial profiles, so one can
refresh the profile while the program is running.  The tool is a very short
Haskell program, so it should be quite easy to modify and improve (and
there is a lot that can be improved in it! :-).

You can use the tool like this:

    hp2html my_profile.hp

This will generate a self-contained HTML file called `my_profile.html`.  I
am attaching some screen-shots so that you can get an idea of what it looks
like.

In the generated HTML, hovering over data points shows their labels in the
top-right corner.  You can zoom into a region by selecting it.  To go back
to the zoomed-out view, double-click anywhere on the picture.   Note that,
by default, the tool does not stack data points on top-of each other like
`hp2ps`.  This makes it easier to see the individual values for the
different entries, but it makes it harder to see the total amount for the
program.  To get the stacked view, use the radio button in the top left
corner.

`hp2html` is available on Hackage:

    http://hackage.haskell.org/package/hp2html-0.1

If you are interesting in improving the tool (please do!), the source repo
is here:

    git clone git://github.com/yav/hp2html.git

I hope that you find it useful,
-Iavor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120220/0f1d679b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prof-types.png
Type: image/png
Size: 182965 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120220/0f1d679b/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prof-bio-zoom.png
Type: image/png
Size: 137373 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120220/0f1d679b/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prof-bio.png
Type: image/png
Size: 263598 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120220/0f1d679b/attachment-0005.png>


More information about the Haskell-Cafe mailing list