Regular Expressions - Python vs Perl

James Stroud jstroud at mbi.ucla.edu
Thu Apr 21 17:46:05 EDT 2005


Is it relevant that Python can produce compiled expressions? I don't think 
that there is such a thing with Perl.

Also, to all of the dozen or so people in the world less wise than me about 
programming: don't choose your language on how fast the regex engine is. This 
would then become a case of premature optimization.

James

On Thursday 21 April 2005 10:23 am, Thomas Bartkus wrote:
> "djw" <dwelch at vcd.hp.com> wrote in message
> news:d48ktk$4ov$1 at news.vcd.hp.com...
>
> > While I agree with (most of) your points, one should not overlook the
> > fact that there are cases when performance does matter (huge datasets
> > maybe?). Since the OP didn't indicate why performance was important to
> > him/her, one cannot assume that its not a valid concern.
>
> Yes, yes, but then - the converse would be true.  One cannot assume it *is*
> a valid concern.
>
> I could have gone further and pointed out that that RegEx module (now re !)
> is probably just C code hooked to Python syntax.  IOW - the execution speed
> of his RegEx module has *nothing at all* to do with the Python language,
> only the efficiency of the particular code library he was using.
>
> All in all, execution speed for any one particular task is a sucky way to
> evaluate a general purpose programming language. If gonzo RegEx query
> performance was of utmost importance, would anyone put either of Perl or
> Python at the top of his list?
>
> Thomas Bartkus

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list