develooper Front page | perl.perl5.porters | Postings from February 2015

Re: [perl #123918] regex end of line match very slow

Thread Previous | Thread Next
From:
Paul Salazar
Date:
February 25, 2015 19:18
Subject:
Re: [perl #123918] regex end of line match very slow
Message ID:
54EDF915.8000508@testspectrum.com
> So pre-COW:
>
>      the regex engine *always* copied after a successful match in the presence
>      of $& etc, going quadratic always, regardless of whether the string is
>      subsequently modified or not; (it actually didn't copy in the just
>      presence of captures, and just returned garbage in $1 etc if the
>      string was modified; this was a tradeoff of performance over
>      correctness).
>
>
All makes sense except I'm not seeing the pre-COW going quadratic. Same 
example ran on 5.8

  ~$ perl -v

This is perl, v5.8.8 built for msys-64int

Running match \s$ on 100000 iterations on concatenated string...
Time: 0.0459511280059814

Running match \S$ on 100000 iterations on concatenated string...
Time: 0.0440521240234375


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About