[MLton] Question on profile.fun

Stephen Weeks MLton@mlton.org
Mon, 6 Jun 2005 15:19:52 -0700


> So, there is an insane shift after flatten and possibly a minor
> shift after contify3.  I don't know if this actually lays the blame
> squarely at the feet of Flatten.flatten (or possibly
> Shrink.shrinkFunction).

You could determine this by separating out the call to shrink from
flatten into a separate pass and then dropping profile labels in
between flattening and shrinking.

> Flatten.flatten doesn't appear to be sensitive to the presence of
> profiling statements in the program.  But, there is something
> definitely going on there.

Maybe.  At least the shrinker does refer to profile annotations.  But
the problem could be due to profile annotations messing up an earlier
pass, which then messes up the input to flatten.  The easiest thing to
do might be to find out the hot loop in wc-scanstream, and then see if
it's the same coming in to flatten, and if so then see what happens to
it in the two different ways flatten can be run (i.e. with or without
profiling labels dropped before it).