[Tutor] Python and Speed

alan.gauld@bt.com alan.gauld@bt.com
Tue, 17 Apr 2001 17:10:29 +0100


> :I think this sort of idea would be interesting for another 
> reason, as well:  the :scripts themselves would be 
> very instructive for aspiring programmers as a example
> :"best" implementation of a particular task.

I'm not sure that's true. The problem with these kinds of 
tasks is that the rapidly degenerate to a performance 
fine tuning exercise. Finely tuned code is rarely typical of 
what you write day to day, nor is it usually very 
maintainable. So proving that "tweaked till it squeaks" 
Python is as fast as "tweaked till it squeaks" Perl just 
doesn't say a lot about day to day tasks.

Maybe a better idea is to point to the production code 
that is written in each language - Majordomo vv Mailman 
for example. Zope vv ??? A fastCGI site using modPerl 
and one using modPython.

Or compare both top Java - in most cases either Perl 
or Python will be faster than Java on a JVM!

FWIW THe Ruby web site carries a comment somewhere that 
their code falls about midway between Perl and Python 
in speed, but retains the readability of Python.


Alan G.