Perl Vs Python

Bo M. Maryniuck b.maryniuk at forbis.lt
Thu Feb 27 15:11:21 EST 2003


On Thursday 27 February 2003 21:59, A.M. Kuchling wrote:
> When I timed a simple pattern (abc.*def) on a 10000-character, Python
> matches in ~7000 usec and Perl in ~8000 usec, but that proves nothing. 

Well, I've tried to provide a HTML colorizer for a diff's, so Perl script does 
very huge diff within 19 sec. and the same diff Python script (with 
re.compile) does more than minute. I've tried to optimise Python script 
several times, using sre, re and so on. Python 2.2 re much faster than Python 
2.1, but still not so fast as Perl's.

Dunno, probably there should be some very deep advantage to make it at least 
the same.

> Huh?  Writing a sensible regex pattern that doesn't backtrack too much
> requires the same set of skills no matter what the host language is.
It was just a joke. :)

-- 
Regards, Bogdan

Microsoft is not the answer.
Microsoft is the question.
"No" or "Linux" is the answer.






More information about the Python-list mailing list