On Tue, Jan 13, 2015 at 12:01:51AM +0000, Olly Betts wrote:
> On Mon, Jan 12, 2015 at 04:29:09PM +0100, Stacho Mudrak wrote:
> > I am sorry, I was never able replicate this bug.
> 
> You need a large log file for it to be noticeable, as the problem seems
> to be that trying to match this pattern causes Tcl's regexp engine to do
> a lot of backtracking:
> 
>   set rx {\S*[^\]\s]\s+\[\d+\]}
> 
> I don't really follow the Tcl code around this, but if this is trying to
> match on lines such as:
> 
> 2253> input:42871 -- gemse.th [4]
> 
> Then adding "-- " to the start of the pattern and then adjusting the
> offsets when highlighting in the text widget should address the problem.
> The fixed substring "-- " serves as a way to efficiently limit where the
> regexp engine tries to match the pattern.

I managed to guess enough tcl and tk to implement this, patch attached
which fixes the 10 minute wait while xtherion parse the log, while still
creating the links as before (at least as best I can tell).

Cheers,
    Olly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-log-file-regexp-backtracking.patch
Type: text/x-diff
Size: 1099 bytes
Desc: not available
URL: 
<http://mailman.speleo.sk/pipermail/therion/attachments/20150113/953273d3/attachment.patch>

Reply via email to