Speed?

Peter Hansen peter at engcorp.com
Tue Jan 6 08:44:08 EST 2004


EP wrote:
> 
> On questions of the suitability of Python for CGI, embedded apps, etc.,
> execution speed comes to mind.  I previously read some comparisons which
> did not show Python in a good light in this regard: i.e. Python is slow
> compared to Perl, C++, Java.
> 
> http://www.flat222.org/mac/bench/
> 
> Is there more authoritative and current information IRT speed comparisons?
> 
> Is newer Python any faster?
> 
> Also, if Python is a bit slower in execution than some alternative
> languages, what do others do in practice to speed it up, and how much of
> that optimization do they do?  Or is a slower speed to be accepted like one
> learns to accept that their lovely bride takes a long time getting ready to
> go out ?

I would question the wisdom of using any generic benchmark (such as the
"console output test" you included) to make decisions about adoption of
key technologies.

Identify the core characteristics of your intended application, code up 
a simple benchmark which contains representative code, and see how it
stacks up against the competition.

We did this with Python on one embedded system we were considering,
with a benchmark that included threading, memory allocation and releasing,
some simple math, and lots of string operations.  The results told us
much more than PyStone or something similar would have, and gave us much
more confidence in the results.

And with Python, of course, it's almost trivial to do this kind of 
thing, compared to some other languages.  Sigh.

-Peter



More information about the Python-list mailing list