On Mon, Mar 16, 2009 at 10:36 PM, Steven H. Rogers <[email protected]> wrote: > Greenlets look like they could be a viable alternative to generators for > simulating concurrency. How expensive are greenlets compared to generators?
I haven't heard of anyone who has benchmarked the difference. I'd be interested in seeing some results myself. I could handwave based on indirect reports, for what it's worth, as it's easier than actually benchmarking it myself :-) The Concurrence framework supports running on top of greenlets and on top of Stackless Python, which greenlets are a spin off of. It claims that there's only a 10-25% difference in performance in Stackless' favour [1]. Stackless Python and a generator based solution were compared in a recent benchmark [2] with generators being around 10 times slower than Stackless. Given that both reports are more or less accurate, I expect greenlets to be considerably faster than generators. Cheers, Richard. [1] http://opensource.hyves.org/concurrence/index.html [2] http://entitycrisis.blogspot.com/2009/03/concurrent-scaling-benchmarks.html _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
