On Sep 18, 2012, at 5:28 AM, Matthew Flatt wrote: > I don't think the parameter overhead is relevant. In Jay's post, he > performs 100k parameter accesses, and it takes 16 milliseconds; we can > reasonably extrapolate 160 msec for 1M accesses. Patrick's generator > example yields 1M times, and takes 18 seconds --- 100x the parameter > overhead. > > I agree with others that the cost of capturing continuations is the > culprit in this case. The run-time system has support for faster > continuations that work in constrained settings (currently used to > implement futures), and it might be possible to make those > continuations kick in work for a typical generator, but I'm not sure. > > Meanwhile, it might be interesting to try implementing a `generator' > form that rewrites its body to implement `yield's that are > syntactically apparent (after local-expansion), leaving parameter and > continuations to handle the general case.
+1! +1! I'm sure this idea flitted through about twenty minds yesterday. John
smime.p7s
Description: S/MIME cryptographic signature
____________________ Racket Users list: http://lists.racket-lang.org/users