Python too slow for real world

Christian Tismer tismer at appliedbiometrics.com
Mon May 3 09:26:27 EDT 1999


Robb Shecter wrote:
> 
> Roy Smith wrote:
> 
> > Paul Prescod <paul at prescod.net> wrote:
> > > It is a performance issue if you don't know that regexps are supposed to
> > > be compiled.
> >
> 
> Hi,
> 
> Sorry if this is obvious, but does the Regex class cache compilations?  I

It has. You can look at it simply by opening re.py .

> couldn't find any info on this.  If it was, it would support subject matter
> experts nicely, like someone else mentioned.  But even as a CS person, I like
> how the Java "ORO" Regex Library has automatic Least Recently Used caching.
> This lets application code be simpler, as well as making it easier to share
> compiled expressions much more easily between objects.

Python does what it can to compile and cache regexen.
It just looses a lot of time with postprocessing of
results, calls to the internal regex machine in pcre
and so on. This part of the regex system will be
coded in C as well in some future, which should
minimize the overhead.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list