Psyco 1.5.2 review
DownloadPsyco project is a Python extension module which can massively speed up the execution of any Python code. What you can do with it
|
|
Psyco project is a Python extension module which can massively speed up the execution of any Python code.
What you can do with it
In short: run your existing Python software much faster, with no change in your source.
Think of Psyco as a kind of just-in-time (JIT) compiler, a little bit like what exists for other languages, that emit machine code on the fly instead of interpreting your Python program step by step. The difference with the traditional approach to JIT compilers is that Psyco writes several version of the same blocks (a block is a bit of a function), which are optimized by being specialized to some kinds of variables (a "kind" can mean a type, but it is more general). The result is that your unmodified Python programs run faster.
Benefits
2x to 100x speed-ups, typically 4x, with an unmodified Python interpreter and unmodified source code, just a dynamically loadable C extension module.
Drawbacks
Psyco currently uses a lot of memory. It only runs on Intel 386-compatible processors (under any OS) right now. There are some subtle semantic differences (i.e. bugs) with the way Python works; they should not be apparent in most programs.
Expected results
The actual performance gains can be very large. For common code, expect at least a 2x speed-up, more typically 4x. But where Psyco shines is when running algorithmical code --- these are the first pieces of code that you would consider rewriting in C for performance. If you are in this situation, consider using Psyco instead! You might get 10x to 100x speed-ups. It is theoretically possible to actually speed up this kind of code up to the performance of C itself.
Because of the nature of Psyco, it is difficult to forecast the actual performance gains for a given program. Just try and see.
The memory overhead of Psyco is currently large. I has been reduced a bit over time, but it is still an overhead. This overhead is proportional to the amount of Python code that Psyco rewrites; thus if your application has a few algorithmic "core" functions, these are the ones you will want Psyco to accelerate --- not the whole program.
Psyco can transparently use a Python profiler to automatically select which functions it is interesting to accelerate.
Requirements:
Python
What's New in This Release:
Bug fixes and Python 2.5 compatibility.
Psyco 1.5.2 keywords