pro python paper

Tim Hochberg tim.hochberg at ieee.org
Tue Aug 10 13:12:28 EDT 2004


beliavsky at aol.com wrote:
[SNIP]
> 
> It is more honest and credible to admit that a Python program often is
> slower than one in a compiled language, but that reduced programming
> time in Python often outweighs this deficit.

That's not been my experience. Most of the stuff that I write in Python 
would have been slower had I written it in C/Fortran etc. Now before you 
pack me off to the loony bin, let me explain. First off I know most of 
the tricks to make Python do things fast, at least in the problem 
domains I care about. Second, in most cases, I'm dealing with situations 
where, the problem is understood (if I'm lucky) but the optimal 
algorithm for solving it is not known. Finally, I don't generally have 
unlimited time to devote to any given problem.

With these conditions (unkown algorithm, finite time), Python often 
comes out ahead of "faster" languages. The reduced programming time 
means that I typically end up with a closer to optimal algorithm and a 
faster algorithm is generally more important for speed than a faster 
language.

Of course these conditions don't always apply. And to certain extent I'm 
guessing as to what kind of code I would have ended up with had I 
attemped a given program in C/Fortran, but I think I have a pretty good 
feel for what it would have turned out like.

As for the paper the parent post referring to, I haven't read it and 
have no opinion on its claims.

-tim




More information about the Python-list mailing list