|
From: Slava P. <sl...@fa...> - 2007-04-17 20:42:51
|
On 17-Apr-07, at 10:29 AM, Csaba Henk wrote: > Ah, thanks, superb. I did look into the coroutines module but > apparently > I was somewhat absent-minded as I looked over the co* words. > > The benchmark result is not in the top category but I think it's still > not bad given that continuations are implemented in the language > itself > (and, as you say, they run interpreted). > > python: 0.02 s Python's generators are not full continuations, in fact I believe they're rewritten to an iterator as a compile-time transform, so the resulting bytecode does not look like the original code at all. This explains why Python is so much faster than the others on this benchmark. > gambit scheme (interpreted): 0.25 s > python with greenlets based > generators: 0.45 s > factor: 0.73 s > ruby: 1.35 s Once Factor's continuations are compiled, performance will improve here. Slava |