Python, like Java, is interpreted at run time. And like Java, Python is compiled to byte codes and saved. With today's processors, Python's runtimes reasonably quick, but not as fast as natively compiled C/C++. (Python and Perl runtimes are roughly equivalent.) [ Ref 1 ]is an optimising static compiler for both the Python programming language and the extended Cython programming language. It makes writing C extensions for Python as easy as Python itself." Cython is based on Pyrex.Should perfomance still be an issue, there are several techniques you can use to improve Python's performance. Profile your application to understand it's bottlenecks and consider one or more of the following techniques.
Older and lesser used techniques include:
Java's JIT, if on, is on full-time and applied to all code. Psyco is not on unless you invoke the compiled functions, and you should only do that for those portions of your application that truely need the acceleration. Pysco only works on 32-bit versions of Python. For 64-bit JIT acceleration one should look to PyPy.