Loop performance disappearance

Tim Peters tim_one at email.msn.com
Fri Mar 17 01:24:12 EST 2000


[Chris Ryland]
> I get the general feeling that among the powers-that-be, optimization is
> considered hard and dangerous? ;-)

If the opposite is easy and safe, I can confirm that the powers-that-be
believe *everything* connected with computers is hard and dangerous <wink>.
Seriously, it's a tradeoff.  Nobody works on Python full-time; Guido Himself
is much more interested in portability, reliability, and ease of gluing to
other systems than with raw speed; and the people who volunteer to *do*
optimization work outnumber the ones who volunteer to *talk* about it by a
factor of roughly 30,000 to 1.

BTW, don't assume that you're writing effective (speedwise) Python today.
Like any other programming notation, it takes time to pick up the proper
idioms.  And also like any other programming notation, you're going to get
orders of magnitude improvement from better algorithm design, not from
effortless compiler optimizations.

> They're quite right of course.
>
> I suppose one approach is that, given a fairly fixed language like Python,
> that Moore's Law improvements in hardware will eventually make Python run
> arbitrarily fast.
>
> The only problem with that viewpoint is that other, more optimized dynamic
> languages go even faster (at the same ratio as today, more or less).

You're allowed to use them too -- but only when speed is really important,
and only when they're actually faster <0.5 wink>.  See

    http://wwwipd.ira.uka.de/~prechelt/Biblio/#jccpprtTR

for a start.

> Maybe I'll see the light after using Python for a few years...

Na.  If the light hasn't dawned after just a few months, cut your losses and
move on.

like-quitting-smoking-most-people-can't-break-an-addiction-
    to-meaningless-speed-until-the-third-through-seventh-
    attempts<wink>-ly y'rs  - tim






More information about the Python-list mailing list