Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Regex match is very slow against deref'd reference to substr/lvalue, is it normal?

by Anonymous Monk
on Aug 12, 2024 at 10:21 UTC ( [id://11161013]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex match is very slow against deref'd reference to substr/lvalue, is it normal?
in thread Regex match is very slow against deref'd reference to substr/lvalue, is it normal?

Thanks. No regexes involved, then. My confusion, partly, was because the "magical object" (MO), in addition to attributes you mention, also keeps value of global anchor position between global match invocations, even though temporary buffer is thrown away each time, as you explained. So, MO is smart enough to notice if referent has been changed to reset this anchor. But not smart enough to somehow employ COW (if it observes referent for changes anyway) to avoid physical copy on every dereference? I thought Perl scalar keeps offset and actual length of string, even though physical buffer may extend on either side? I.e. same as result of substr. OK, perhaps reality of MO is more complex than my simple model above, thanks for your answer, again.

  • Comment on Re^2: Regex match is very slow against deref'd reference to substr/lvalue, is it normal?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-09-18 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (24 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.