[MLton] Question on profile.fun
Sun, 5 Jun 2005 23:35:39 -0400 (EDT)
> So, this seems to suggest that the slowdown due to missed SSA
> optimizations is fairly low, though it is the cause of the insane behavior
> of wc-scanStream. Knowing that, it is probably worth adding to a TODO to
A quick investigation turned up this surprising result. I wrote a little
SSA pass to drop profiling expressions from an SSA IL program (and set
Control.profile to ProfileNone) and inserted it after every pass in the
SSA optimization sequence. I measured the running time of wc-scanStream
when compiled with flags like
-profile drop -drop-pass "dropProfile[A-G]"
This means that profiling information is carried by the program until the
dropProfileH pass, after which there is no profiling information in the
Here's what I observed. The running time before dropProfile* is the
running time when that instance of dropProfile is the first to run.
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).
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.