Python's Performance

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sun Oct 9 06:05:30 EDT 2005


On Sat, 08 Oct 2005 10:14:25 -0700, Phillip J. Eby wrote:

> So, without meaning to, the benchmark author has demonstrated something
> important about Python, which is that writing the obvious thing in
> Python tends to work correctly, even if it sometimes takes longer to
> run than it would take for another language to produce the wrong
> answer.  :)

Which is of course demonstrates two different strategies of programming.

The first is, "I don't care what answer I get, so long as I get it quickly!".

The second is, "I don't care how long it takes, so long as I get the right
answer!"

The smart programmer will understand that both strategies can be the right
one in different circumstances. For instance, the Apollo landers didn't
have the computing power to calculate the right answer quickly enough to
prevent the lander from burying itself deep beneath the moon's surface, so
they used a strategy of calculating the wrong answer quickly, then
incrementally improving it.

I'm told that the Apollo 11 lander's computer rebooted something like 20
times in the few minutes it took to go from orbit to the surface. It would
crash, reboot, and just pick up the calculations from the last one that
completed. Try doing that with Wintel! :-)


-- 
Steven.




More information about the Python-list mailing list