[Haskell-cafe] Help with profiling

Uri Braun uribraun at eecs.harvard.edu
Fri Dec 6 01:13:18 UTC 2013

Hi Café,

I'm attempting to profile my rather large (~18K LOC) Haskell program that
primarily manipulates graph structures based on Data.IntMap. The program is
chewing up _lots_ of memory (approx. 4G for 2.5K nodes & 2.5K edges) and I
have profiled it in an attempt to figure out why. It appears that the .prof
and .hp (which I visualize with hp2ps -c) files do not agree on the source
of the problem. The hp results are located at:
http://www.eecs.harvard.edu/~uribraun/sybil.ps and the top of the .prof file
looks like this:

COST CENTRE                   MODULE                  %time %alloc

compare                       Policy.Edge              21.7   50.0
eqPartition.edges             Policy.EdgeQuad           6.5    3.7
toConstructedSet              Types.TaggedIntMultimap   6.1    3.6
elems                         Types.TaggedIntMap        6.0    6.8
elems                         Types.TaggedIntSet        5.7    3.8
toPairs                       Types.TaggedIntMultimap   3.9    5.2
assocs                        Types.TaggedIntMap        3.2    4.1
eqIsValid                     Policy.EdgeQuad           2.9    0.5
rIsValid                      Policy.Relations          2.2    0.2
assocs.\                      Types.TaggedIntMap        1.8    0.0
keysSet                       Types.TaggedIntMap        1.5    1.7
mergeIdenticalNodesT.exactMap Minimize.MergeIdentical   1.4    1.2
fromList                      Types.TaggedIntSet        1.3    1.6
tePartitionSrc                Policy.TaggedEdge         1.2    0.9
null                          Types.TaggedIntSet        1.2    0.0
scc.comps                     Policy.Scc                1.2    0.9
tePartitionTgt                Policy.TaggedEdge         1.1    0.8
member                        Types.TaggedIntSet        1.1    0.8
alter                         Types.TaggedIntMap        1.0    1.1

Also, the line in the .prof that corresponds to the anormUnion.name (what
the hprof image claims is taking up space) looks like (some spaces removed):
anormUnion.name Anormalize.Anormalize                2914          60    0.0
0.0     0.0    0.0

My main questions at this point are:
1.	What are the chances the hprof image is just wrong?
2.	What would you suggest I try next in debugging my space issue?

This is my first big Haskell program, please do inform me of any big war
tools I don’t know about.

Many thanks in advance!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131205/b0d98069/attachment.html>

More information about the Haskell-Cafe mailing list