Friday, December 14, 2007

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.

5 comments:

Michael Foord said...

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 said...

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 said...

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

Anonymous said...

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 said...

Hi gyro!

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