[pypy-dev] PHP interpreter and rdict performance

Alex Şuhan alex.suhan at gmail.com
Thu May 12 20:15:37 CEST 2011


Hello. We're working on a tracing JIT for PHP using PyPy 
(https://bitbucket.org/asuhan/happy). It's still in its infancy, but it 
has a bunch of features already in place and beats Zend & HipHop by a 
large margin in some microbenchmarks -- sieve (and other arithmetical 
stuff) and lots of tests based on PHPbench.

However, we’re struggling with poor performance (2x slowdown compared to 
Zend) for dictionaries -- especially set operations. The implementation 
in pypy/rpython/lltypesystem/rdict.py seems perfectly fine at a first 
glance and we’re relying on it for implementing PHP arrays.

pypy-c (built from 43932 changeset) is also about 2x slower than CPython 
for something like:

a = {}
t = 0
while t != 1000000:
     a[t] = t
     t += 1

While we’re not expecting dictionaries to benefit from JIT magic, it’s a 
little strange that the “baseline” performance is not up to par. Is 
there a way of circumventing this issue?

Many thanks for this piece of software and keep up the good work.

-- 
asuhan


More information about the pypy-dev mailing list