continuations to optimize code

Thomas Lindgren thomas.lindgren@REDACTED
Wed Dec 5 14:35:59 CET 2001

> This brought the processing time of megaco_text_parser.erl down
> again from 15 minutes to 100 ms -- ...!!!

Congratulations on an interesting performance hack!

Those are very interesting timing results, because your CPS-transformation
builds a closure instead of pushing a stack frame. As far as I
can see from the example, the savings then lie in avoiding the
tuple. If so, that's remarkable.

(A similar technique for returning multiple values is used in
SML compilers.)

And to those interested, yes, I'm actually working on doing
something along those lines in OM :-)

-- Thomas

More information about the erlang-questions mailing list