[racket] generator performance

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Sep 18 21:05:57 EDT 2012

10 minutes ago, Matthew Flatt wrote:
> At Tue, 18 Sep 2012 20:46:40 -0400, Eli Barzilay wrote:
> > A few minutes ago, Matthew Flatt wrote:
> > > 
> > > Using `call/cc' for generators is effectively a hint to the run-time
> > > system that the continuation doesn't need to compose. That hint is
> > > useful only because of the way that continuations are implemented
> > > internally.
> > 
> > So `call/cc' is faster than one of the delimited ones?
> >
> > -- I tought that the main cost would be in the amount of stack saved
> > which would make delimited ones faster,
> 
> There's no such thing as an un-delimited continuation in Racket. A
> continuation captured with `call/cc' is delimited by a prompt, just
> like a continuation captured with
> `call-with-composable-continuation'.

Yeah -- I mean that `call/cc' usually has more context, so it seems
that it would be generally more expensive, and that seems wrong--?


> The difference is whether the continuation is composable (at a boundary
> other than a prompt).

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.