How to make regexes faster? (Python v. OmniMark)

Tim Peters tim.one at comcast.net
Sat Apr 20 01:17:42 EDT 2002


[Donn Cave]
> ...
> I'm really delighted to hear about performance improvements in file
> object input in recent Python versions (in a message that would
> have been in this thread if Tim Peters used a newsreader instead
> posting to the list.)

Hmm.  Shows up fine in the newsreader I use -- this, like hearing about the
speedups for the first time from that msg, may be another symptom of General
Upgrade Fear <0.9 wink>.

> Mostly because it's a good thing in itself, assuming the numbers are
> there, but also because it shows that someone must have felt that
> performance was important enough to work pretty hard on it - that's a
> healthy sign.

Python-Dev was consumed by it at the time (December of 2000).

> By the way, I'll second Johannes Stiehler's recommendation of
> MxTextTools.  Definitely appropriate for SGML parsing, and much
> better than regexps for extensive parsing in my opinion - not
> just in terms of speed, but I suspect a more powerful way to
> describe text patterns than regexps.

Yes, it is.  "More convenient" is arguable, though -- there's a steep
learning curve, but then people often forget how hard it was to learn regexp
syntax and pragmatics too.






More information about the Python-list mailing list