Technical mailing list archives

Re: PyPy

by Eneldo Serrata <> - 12/11/2014 09:32:13
I would work on this, when you have a lot of data is very slow Odoo

On Dec 11, 2014, at 5:57 AM, Ruben De Smet <> wrote:

Hello Odoo developers

I was reading some things on PyPy, the JIT python interpreter and I
thought this could be something very interesting for Odoo, to reduce
memory usage and CPU time.

According to this [1] (simple) benchmark, PyPy cuts memory usage in half
and reduces runtime to one third. This counts for memory intensive
applications and I think Odoo is among those.

Think of it: cutting memory usage and cpu usage in half means you can
double the amount of Odoo instances run on one server and therefore
could cut the TCO in half, especially for large Odoo installations.

According to this [2] article written by an Odoo developer, OpenERP
8-trunk ran in PyPy back then, using some minor changes.

Caveats included
1) Using psycop2cffi instead of psycop2 because it's faster and more
elegant (and psycop2 doesn't work using pypy). That means that the
(legacy) psycopg1cursor calls had to be replaced by something else which
is explained in the article.
2) There was a segfault (with regard to unicode) in psycop2cffi which
was fixed by him [3]
3) Another segfault: "After a bit of digging, it would seem the segfault
happens sometimes when calling the function on line 923 of

I haven't tried anything regarding PyPy myself yet, but I'm planning to
in the near future.

For 1) I'd suggest I take a look if those call can be replaced by the
newer (non-legacy) variant. Regarding to the article, "and this should
serve as note to core developers to drop the psycopg1.cursor and use the
DictCursor in the psycopg.extras modules which implements a much better
and faster algorithm."

2) Has been fixed already

For 3) I'd suggest the same. I'll try out Odoo on PyPy, list the caveats
and try to produce a smooth fix, be it in Odoo, in PyPy or in some
project else.

My questions to this list:
- Are there people, other than me, interested in using Odoo on PyPy?
- Could, once tested and stable, PyPy become officially supported? I'm
willing to take the testing and developing on me.
- Would Odoo accept patches (on github) to make Odoo work on PyPy?

In any case, I'll report back my findings (being caveats and performance
statistics, if I can gather those) when trying this out.

Thank you for reading through! Any feedback is welcome

Ruben De Smet


Post to:

  • PyPy

    - 12/11/2014 04:54:45 - 0

    6 replies 6 replies