in reply to Matching lines in 2+ GB logfiles.
The reason for the slow execution is most likely the use of the two .* in the regex which result in a very high number of checks inside the regex machine. This is difficult to explain as long you don't know what backtracking is and how it works.
For now just try this:
For now just try this:
while ( $window =~ m/\w{3}\s{1,2}\d{1,2}([^\n]+)\n/oigc && $1 =~ /$re/ +) { &$callback($1); }
Precompiling $re using qr{} is recommended, or use the o option.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Matching lines in 2+ GB logfiles.
by dbmathis (Scribe) on May 01, 2008 at 17:10 UTC |
In Section
Seekers of Perl Wisdom