in reply to Re^2: Inexplicably slow regex
in thread Inexplicably slow regex

It looks like it needs many lines to have a partial match in order to slow things down. Try executing this line before adding the matching line:
s/^/ /mg;

Replies are listed 'Best First'.
Re^4: Inexplicably slow regex
by Skeeve (Parson) on Sep 13, 2006 at 06:48 UTC
    I've put the line just before $_.= "\n    df   "; and still no big difference:
    542450
               Rate    cr caret
    cr    1105787/s    --   -2%
    caret 1131435/s    2%    --

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      Thanks for your efforts. I'm at a loss to explain the differences you're seeing. I'm obviously using different input data. It would be interesting to know whether your results differ from the example provided by the user grandfather, since he was able to create a complete self-contained example.