Pypy JIT

11 views
Skip to first unread message

Nil Geisweiller

unread,
Jul 10, 2011, 4:42:40 AM7/10/11
to OpenCog
Hi,

just a few words to report my use of PyPy http://pypy.org/, a JIT
compiler for Python.

It is a follow-up project of Psyco, an supposedly faster and lighter
alternative to CPython.

In theory it's faster but I tried on some Python code of mine (parsing
a large data file and performing some processing on it). And PyPy was
almost twice slower than CPython BUT it took almost twice less memory.

I tend to write rather efficient Python code (almost never use loops,
etc) so that might be the reason.

As shown here http://speed.pypy.org/ the results are very variable
depending on the program, so it might work better for you and in my
instance it cut down RAM usage by almost x2 which can already be quite
useful when memory is the limiting factor (which often occurs in
Python).

Anyway, certainly not as good as Cython but instantly usable.

Nil

Joel Pitt

unread,
Jul 10, 2011, 10:28:37 PM7/10/11
to ope...@googlegroups.com
On 10 July 2011 16:42, Nil Geisweiller <ngei...@googlemail.com> wrote:
> As shown here http://speed.pypy.org/ the results are very variable
> depending on the program, so it might work better for you and in my
> instance it cut down RAM usage by almost x2 which can already be quite
> useful when memory is the limiting factor (which often occurs in
> Python).
>
> Anyway, certainly not as good as Cython but instantly usable.

It looks promising, and the native support for microthreads sounds cool.

I wonder whether Cython will support compiling(?*) against PyPy?

J


* I always thought PyPy was written in Python, so I'm not sure what
the exact process of providing bindings that work with Pypy requires.

Joel Pitt

unread,
Jul 10, 2011, 10:29:26 PM7/10/11
to ope...@googlegroups.com
On 11 July 2011 10:28, Joel Pitt <joel...@gmail.com> wrote:
> On 10 July 2011 16:42, Nil Geisweiller <ngei...@googlemail.com> wrote:
>> As shown here http://speed.pypy.org/ the results are very variable
>> depending on the program, so it might work better for you and in my
>> instance it cut down RAM usage by almost x2 which can already be quite
>> useful when memory is the limiting factor (which often occurs in
>> Python).
>>
>> Anyway, certainly not as good as Cython but instantly usable.
>
> It looks promising, and the native support for microthreads sounds cool.

Ah - I'd heard of Stackless Python, I didn't realise Stackless was a
subproject of PyPy though.

J

Reply all
Reply to author
Forward
0 new messages