[MLton] cvs commit: fixed quadratic liveness for list constants

Stephen Weeks MLton@mlton.org
Wed, 30 Jun 2004 10:38:58 -0700

> I'm curious: did you see any benchmarks were the reversing of `constant'
> lists cost any thing?

I didn't run the benchmarks before and after.  It's worth someone
adding a flag (-list-thresh <n>) and trying it out.

> I'm particularly thinking of cases where, because of the reversal,
> MLton might not globalize some list.

True, this could happen.  With the new stuff, the reversed list should
still get globalized, but the compiler won't simplify away the call to

BTW, I was thinking it would be nice to have a generalization of this
hack that works for arbitrary data structures.  The idea would be to
build up a continuation from left-to-right that knows how to build the
desired structure.  The reversed list is then a very specialized
representation of a continuation in the general construction.