[MLton-devel] eliminating HandlerPush/Pop

Henry Cejtin henry@sourcelight.com
Fri, 10 Jan 2003 10:37:26 -0600


I'm  amazed  that  the  result  was an improvement for count-graphs.  I'm not
surprised that it showed the largest effect, but that the effect was good.

Count-graphs uses a complicated kind of fold-over-tree which really wants  to
call  the  folder  with  3 continuations: one is the `just keep folding', the
second is to abandone the current branch (i.e., the sub-tree  rooted  at  the
current  node) but to continue with the rest of the tree, and the third is to
abandon the entire fold.  Instead of using 3  continuation  functions,  which
would  result in all the live data moving to the heap, I call the folder with
the first continuation and pass two exceptions around which the folder raises
to  abort  up to get to the other two continuations (which were always a part
of the first continuation).  The result is a huge number of handlers, many of
which are actually reached and many of which are not.

Not a typical piece of code, but a very heavy user of exceptions.


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel