Performances of Pyhton programs

Christian Tanzer tanzer at swing.co.at
Mon Feb 18 12:41:11 EST 2002


Roy Smith <roy at panix.com> wrote:

> bairef2 at cti.ecp.fr (François Baire) wrote:
> > Are there any benchmark or does anoyone know what are the performances of a
> > program written in python (in terms of CPU and RAM) compared with other
> > languages (especially C++ and compiled languages) ?
> >    I've met many articles which explain that python programs are slowler
> > because it uses the interpreter, but none says how much slower it is ! I
> > would like to know this for a rather big OO program which uses standard
> > fonctions of the language.
>
> There is little doubt that a program written in C/C++ will be faster than
> the same algorithm implemented in Python (or any of the common "scripting"
> languages such as Perl or TCL).  How much slower depends to a very large
> degree on exactly what you're doing.

True, but misleading. A Python solution might use very different
algorithms than a C/C++ solution. As the first working version of a
Python solution is achieved much earlier than a C/C++ solution, there
is a lot of time left to optimize if and where necessary.

In my experience, a Python solution might be anywhere between 100
times slower to 1000 times faster than a C/C++ solution.

YMMV.

-- 
Christian Tanzer                                         tanzer at swing.co.at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92






More information about the Python-list mailing list