Devin Jeanpierre <jeanpierr...@gmail.com> added the comment:

> In practice, I expect that a pure Python implementation of a regular 
> expression engine would only be fast enough to be usable on PyPy.

Not sure why this is necessarily true. I'd expect a pure-Python implementation 
to be maybe 200 times as slow. Many queries (those on relatively short strings 
that backtrack little) finish within microseconds. On this scale, a couple of 
orders of magnitudes is not noticeable by humans (unless it adds up), and even 
where it gets noticeable, it's better than having nothing at all or a 
non-working program (up until a point).

python -m timeit -n 1000000 -s "import re; x = 
re.compile(r'.*<\s*help\s*>([^<]*)<\s*/\s*help.*>'); data = ' '*1000 + '< help 
>' + 'abc'*100 + '</help>'" "x.match(data)"
1000000 loops, best of 3: 3.27 usec per loop

----------
nosy: +Devin Jeanpierre

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to