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

Donn Cave donn at drizzle.com
Sat Apr 20 00:57:21 EDT 2002


Quoth sjmachin at lexicon.net (John Machin):
...
| Another practical perspective:
|
| When people mention excessive run-time to me, I ask them to rank the
| severity of their problem on this scale:
| 1. Job doesn't finish before they get back to their desk with a fresh
| mug of coffee.
| 2. Job has (exclusive access to database or excessive impact on
| on-line response time) and doesn't finish by sun-up.
| 3. Job doesn't finish before the weekly cold back-up is due.

How would you score a CGI program on a busy server in that scale?
Or for that matter any program that runs on a busy server.  And
I drink enough coffee, without refilling the cup every time I run
some software that makes me wait.

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.)  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.

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.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list