Python 2 times slower than Perl

Greg Jorgensen gregj at
Thu Jul 19 23:05:03 EDT 2001

"Roman Suzi" <rnd at> wrote:

> Posting tests showing performance weakness in some typical situations
> is needed to make Python better.

Refining and optimizing Python is a good thing. But these "benchmarks" that
show Python slower or faster than language X don't help. Writing real-world
Python programs, then profiling and optimizing them, and perhaps finding
places to improve the runtime system, the compiler, or the standard
libraries: that is useful. Comparing Python's ability to multiply
floating-point constants a million times in a loop is not useful, not even
when compared to Perl and C.

Every Python program I've written since I started with Python (about a year
ago) has saved me a lot of time. Whether my program might have executed in 3
seconds instead of 5 if I had used Perl (which I can neither read nor write)
is irrelevant. If I was convinced that Perl was 100 times faster I might
ditch Python, but for what I do with it Python is more than fast enough, and
certainly fun enough. If I really had to multiply floating-point numbers
millions of times I'd write the code in C.

> These benchmarks also show how good someones Python is compiled. For
> exaple, I saw that my AMD K6 225 makes almost same results as somebody
> elses Celeron 450 ;-)

They probably have screensavers and Napster and a bunch of other background
crap running on their machine. The lack of even basic controls in the
benchmarking environment changes the results from useless to dangerous.

Greg Jorgensen
PDXperts LLC
Portland, Oregon, USA

More information about the Python-list mailing list