[pypy-dev] Speeding Up SimPy
richard.m.tew at gmail.com
Tue Mar 17 04:18:53 CET 2009
On Mon, Mar 16, 2009 at 10:36 PM, Steven H. Rogers <steve at shrogers.com> 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 .
Stackless Python and a generator based solution were compared in a
recent benchmark  with generators being around 10 times slower than
Given that both reports are more or less accurate, I expect greenlets
to be considerably faster than generators.
More information about the Pypy-dev