[pypy-dev] Speeding Up SimPy

Steven H. Rogers steve at shrogers.com
Tue Mar 17 03:36:15 CET 2009

SimPy (http://simpy.sf.net) is a very nice discrete event simulation 
package written in Python.  It is, however, rather slow for large models 
and I'm looking at ways to speed it up.  SimPy should be a good test 
case for PyPy and when the JIT stabilizes, PyPy may provide faster 
execution times. 

As we'd like to see some immediate benefits, I've tried Psyco which 
provides a worthwhile 45% improvement on one model and I'll look at 
modifying SimPy to work better with it.  SimPy makes heavy use of 
generators, so I'm interested in the support for them planned for the 
next release.  How close is Psyco generator support to being useful?

Greenlets look like they could be a viable alternative to generators for 
simulating concurrency.  How expensive are greenlets compared to generators?


More information about the Pypy-dev mailing list