Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: substrings that consist of repeating characters

by salva (Canon)
on Sep 29, 2020 at 12:41 UTC ( [id://11122328]=note: print w/replies, xml ) Need Help??


in reply to Re: substrings that consist of repeating characters
in thread substrings that consist of repeating characters

IIRC, once perl sees $& anywhere in the program code, it starts to populate that variable (and $' and $`) for all the regular expression matches in the program. Using it impacts the performance of all the regular expressions in the code, not just those ones where it is actually needed!

Replies are listed 'Best First'.
Re^3: substrings that consist of repeating characters
by Eily (Monsignor) on Sep 29, 2020 at 13:16 UTC

    perlvar does mention the issue, but it also says this has been fully fixed since v5.20.

    Edit: so this would mean that you might still get the same relative positions for the different versions on older version of perls, because although $& would be significantly worse than the other solutions on their own, it would actually lower the performances of all other versions when used in the benchmark.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122328]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found