[pypy-dev] Speeding Up SimPy
Richard Tew
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 [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
More information about the Pypy-dev
mailing list