Python too slow for real world

Roy Smith roy at popmail.med.nyu.edu
Mon Apr 26 16:01:41 EDT 1999


Paul Prescod <paul at prescod.net> wrote:
> It is a performance issue if you don't know that regexps are supposed to
> be compiled.

I hope this doesn't sound as bad as I fear it might, but part of being a
good programmer (or at least a good computer scientist) is to understand
performance issues like this.

Regular expression theory hasn't changed a whole bunch in the last 20
years; it's the same stuff in C, Perl, and any other language that has RE
functionality (either built-in or through some library).  The idea of
factoring constant operations out of loops is the same today is it was 10,
20, 30 years ago.

If you don't know that RE's get compilied (and that the compilation stage
can be expensive), you don't understand the tool you're using.  If you
don't understand that factoring the expensive constant compilation process
out of a loop is important to make your program run fast, you aren't a
good programmer.  No programming language can help that.

-- 
Roy Smith <roy at popmail.med.nyu.edu>
New York University School of Medicine





More information about the Python-list mailing list