[issue846388] Check for signals during regular expression matches

2008-02-04 Thread Guido van Rossum
Guido van Rossum added the comment: Backported to 2.5.2 as r60576. (The other deltas are not backported.) Tracker <[EMAIL PROTECTED]> ___ Py

[issue846388] Check for signals during regular expression matches

2008-01-31 Thread Guido van Rossum
Guido van Rossum added the comment: I think this is worth backporting to 2.5.2. This and r60054 are the *only* differences between _sre.c in 2.5.2 and 2.6. Tracker <[EMAIL PROTECTED]>

[issue846388] Check for signals during regular expression matches

2008-01-09 Thread Facundo Batista
Facundo Batista added the comment: Retried it in a platform where I trust timing, and it proved ok. So, problem solved, no performance impact, all tests pass ok. Commited in r59862. Thank you all! -- resolution: -> fixed status: open -> closed Tra

[issue846388] Check for signals during regular expression matches

2008-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: Mind if I assign this to Facundo? Facundo, if you wish to pass this on, just unassign it. -- assignee: effbot -> facundobatista nosy: +gvanrossum Tracker <[EMAIL PROTECTED]> ___

[issue846388] Check for signals during regular expression matches

2008-01-04 Thread Ralf Schmitt
Ralf Schmitt added the comment: ./python Lib/timeit.py -n 100 -s "import re;r=re.compile('a?a?a?a?a?a')" "r.match('a')" gives me for Trunk: 100 loops, best of 3: 3.02 usec per loop 100 loops, best of 3: 2.99 usec per loop 100 loops, best of 3: 3.01 usec per loop Patched:

[issue846388] Check for signals during regular expression matches

2008-01-04 Thread Facundo Batista
Facundo Batista added the comment: Couldn't apply cleanly the patch, as it appears to be a diff in other format. Anyway, applied it by hand, and now I attach the correct svn diff. The test cases run ok with this change, and the problem is solved. Regarding the delay introduced, I tested it wit

[issue846388] Check for signals during regular expression matches

2008-01-04 Thread Christian Heimes
Changes by Christian Heimes: -- type: -> rfe versions: +Python 2.5, Python 2.6 -Python 2.4 Tracker <[EMAIL PROTECTED]> ___ Python-b

[issue846388] Check for signals during regular expression matches

2007-11-02 Thread Ralf Schmitt
Ralf Schmitt added the comment: hm. just noticed that calling PyErr_CheckSignals slows down regular expression matching considerably (50%). I'm adding another patch, which only checks every 4096th iteration for signals. Added file: http://bugs.python.org/file8680/patch.speedup

[issue846388] Check for signals during regular expression matches

2007-11-02 Thread Ralf Schmitt
Ralf Schmitt added the comment: I'm attaching a working patch against 2.5.1 and a short test program. #! /usr/bin/env python import signal import re import time def main(): num=28 # need more than 60s on a 2.4Ghz core 2 r=re.compile("a?"*num+"a"*num) signal.signal(signal.SIGALRM

[issue846388] Check for signals during regular expression matches

2007-11-02 Thread Ralf Schmitt
Ralf Schmitt added the comment: here is an example (from http://swtch.com/~rsc/regexp/regexp1.html) python -c 'import re; num=25; r=re.compile("a?"*num+"a"*num); r.match("a"*num)' At work I have seen a real world case of a regular expression which ran for minutes rendering the application unres