Piers Cawley writes: > > You seem to be mixing up different issues with that statement. Using > > plain Continuation PMCs for returning just from subroutines was dead > > slow, w or w/o COWed stacks. > > But when a Continuation is simply a collection of pointers to the tops > of the various stacks (and I really do think it should include P1 in > that list...) will it really be that slow? I'm surprised.
I implemented this in the register stacks, but I didn't spend any time on optimization (and who knows, I may have even been marking the stacks COW unnecessarily). Continuation creation, call, and return had great performance. But the problem was that pushtop, etc. were much slower than with the current scheme. I would love to see RetContinuation leave, honestly. One of the greatest things about CPS is that you can grab anybody's continuation that they passed you and store it somewhere. RetContinuation is just a computed goto. But more than I want to see RetContinuation leave, I want to see sub calls fast. Maybe when I get some time again I'll implement single frame linked stacks for a benchmark. Luke