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

M.-A. Lemburg mal at lemburg.com
Thu Apr 25 06:53:40 EDT 2002


Andrew Dalke wrote:
> 
> Now, mxTextTools.  Three attempts.  First two failures took a week,
> thereabouts.  The final success took another couple weeks to get a
> working regexp parser (yes, on top of mxTextTools) going.  Let's
> call it three weeks.  And this was after knowing a lot about how
> those As work.
> 
> But I gotta say, mxTextTools is amazingly fast and flexible.  On
> one test it was only 50% slower than fgrep for a simple text search.
> (Not quite a direct comparison because the Python code was doing
> other things as well.)

Side-note: fgrep uses assembler on some platforms whereas mxTextTools
relies on the quality of the C optimizer to reach top speeds.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/





More information about the Python-list mailing list