[pypy-dev] your thoughts on low level optimizations

Maciej Fijalkowski fijall at gmail.com
Thu Sep 1 19:26:44 CEST 2011


Hi Gert Jan.

Let me clarify what I got from your question - does it make sense to
write performance sensitive code in C, or would PyPy optimize loops
well enough?

If you want to use only PyPy, you can quite easily use numpy arrays to
get a C-like performance. indeed, hakan ardo was able to run his video
processing routines (using array.array instead of numpy.array, but
that's not relevant) at almost C speed [1] and we'll get there at some
point in not so distant future. Also numpy vector operations are
already faster using PyPy than cpython (by stacking multiple
operations in one go) and we're planning to implement SSE in some
not-so-distant future.

This is however, if you plan to use PyPy. Those kind of solutions
don't work on CPython at all.

[1] http://morepypy.blogspot.com/2011/07/realtime-image-processing-in-python.html

I hope that answers your questions.

Cheers,
fijal


More information about the pypy-dev mailing list