Skip to main content

Faster implementation of classic classes merged

Old-style classes have so far been a bit neglected by PyPy's Python interpreter. By default, PyPy makes all classes new-style and you have to use a command-line switch (--oldstyle) at startup or at translation time to change that default. Then you would get an pure-Python implementation of classic classes. This implementation was extremely slow (around 20 times slower than classic classes in CPython). In the past we had hoped that we could get away with mostly only supporting new-style classes, however it seems that real-world software seems to rely on them quite a bit, so we decided to offer a better migration path. A while ago I therefore started a re-implementation of classic classes in RPython to speed them up. This work is now finished, the branch I worked on got merged today. Speed for the old-style class benchmarks was improved greatly and I found quite a number of bugs in the old implementation too. New-style classes are still a bit faster than old-style in PyPy though, and this is unlikely to change.

Comments

Michael Foord wrote on 2007-12-14 18:29:

Hey guys - its great to hear so much about PyPy progress. Keep up the good work (coding *and* blogging of course).

Michael

Carl Friedrich Bolz-Tereick wrote on 2007-12-14 18:38:

Hi Michael!

It seems we are slowly getting into this blogging thing. Good to hear that somebody is actually reading that stuff too :-).

Cheers,

Carl Friedrich

Anonymous wrote on 2007-12-15 01:05:

Of course it is being read, more please :)!

Anonymous wrote on 2007-12-20 14:10:

Dear Carl and other PyPy developers,
Thank you for all of your hard work in getting PyPy to its present impressive state.
I really enjoy reading about your activities and accomplishments on this blog and on the PyPy irc logs.

-gyro

Carl Friedrich Bolz-Tereick wrote on 2007-12-20 14:23:

Hi gyro!

Really impressive that you chew through all the IRC-logs: Even I find that a lot of work sometimes :-)