Tuesday, July 21, 2009

pypy and psyco

The first exploration will concern two projects that aim to speed up Python, namely pypy and psyco. The plan is to learn one or both of these projects in enough detail to make at least one significant contribution. It's a big task, and there will presumably be many posts on this topic.

The first step is to get some idea of what these projects are all about. The Wikipedia entries give excellent introductions:

http://en.wikipedia.org/wiki/PyPy
http://en.wikipedia.org/wiki/Psyco

Each project might be called a jit:

http://en.wikipedia.org/wiki/Just-in-time_compilation
http://en.wikipedia.org/wiki/Run-time_algorithm_specialisation

The two projects are very different. There are many "fancy" ways to describe the differences, but the most obvious difference is:

- psyco is written in C (mostly)
- pypy is pure python.

With psyco, what you see is what you get (and all that you get). In contrast, pypy works on any python code (including itself), so all optimizations within pypy will improve pypy itself.

That's enough for now. The next post will discuss what we might reasonably expect from these projects. That is, we will look at what "success" might mean.

Edward

1 comment:

  1. > With psyco, what you see is what you get (and all that you get).

    This isn't too clear. What I meant was that the psyco source code can't be changed by psyco itself. Only Christian Tismer, psyco's maintainer, can do that.

    ReplyDelete