Python versus Perl

Roy Smith roy at panix.com
Sat Sep 10 21:11:34 CEST 2005


Dieter Vanderelst <dieter.vanderelst at ugent.be> wrote:
> 1 - How does the speed of execution of Perl compares to that of Python?

To a first-order approximation, Perl and Python run at the same speed.  
They are both interpreted languages with roughly the same kind of control 
flow and data structures.  The two have wildly different kinds of syntax, 
but the underlying machinery is fairly similar.

Don't make a decision on which to use based on execution speed.  If you 
feel compelled to ignore this advice, then don't make the decision until 
you've coded your application in both languages and done careful 
benchmarking with realistic data for your application domain.

> I have noticed that Regular Expressions are executed very fast in 
> Python. Does anybody know whether Python executes RE faster than Perl 
> does?

Same answer as above -- for a first cut, assume they are the same speed.  
If you insist on a better answer, do measurements on real data.

The big advantage the Python has over Perl is speed of development and ease 
of maintenance (i.e. a year from now, you can still understand what your 
own code does).



More information about the Python-list mailing list