[MLton-user] Tracking down allocations

Joe Hurd joe at gilith.com
Sun Jul 15 23:24:10 PDT 2007


Hi Matthew,

> If tuple_32 is passed as an argument to
> another SSA function, then it may be a case of the input programs being
> just different enough that the flattening optimization behaves differently
> on them.

tuple_32 is indeed passed into another function. To make things
crystal clear to the compiler I've stuck with the manually
lambda-lifted version.

One last question. I have a big function with 81 patterns like this:

datatype t = A | B | C;

fun f A A A A = ...
  | f A A A B = ...
  | ...
  | f C C C C = ...

where each of the right hand sides are just a single function call. It
is called precisely once, and the call-site is accounting for 50% of
the execution time of the whole program. Am I right in assuming that
this is reflecting the cost of the pattern match, and is there
anything that can be done to speed it up?

Thanks for your help,

Joe



More information about the MLton-user mailing list