in reply to Re^2: An optimization of last resort: eliminate capturing from your regexps
in thread An optimization of last resort: eliminate capturing from your regexps

I think that's what it does already.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

  • Comment on Re^3: An optimization of last resort: eliminate capturing from your regexps

Replies are listed 'Best First'.
Re^4: An optimization of last resort: eliminate capturing from your regexps
by Aristotle (Chancellor) on Jul 24, 2006 at 23:31 UTC

    That would contradict tye’s explanation:

    Capturing in a regex imparts a performance hit because it means that a copy will be made of the string that the regex is being applied to (which makes it a worse performance hit when matching against really large strings – one of the worst cases being running a lot of little regexes with capturing against the same huge string, something a parser is likely to do).

    I don’t see how what tye said would apply if perl already behaved the way I said it should.

    Makeshifts last the longest.

      Perl makes a copy if there is capturing or PL_saw_ampersand is true. I think you said that perl makes that copy immediately on partial success or similar. I responded saying that I think perl waits until the match has succeeded to make the copy. I don't think what I just said contradicts tye at all especially as tye is also right.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊