Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: regex gotcha moving from 5.8.8 to 5.30.0?

by choroba (Archbishop)
on Feb 09, 2021 at 22:44 UTC ( #11128157=note: print w/replies, xml ) Need Help??


in reply to Re^2: regex gotcha moving from 5.8.8 to 5.30.0?
in thread regex gotcha moving from 5.8.8 to 5.30.0?

I usually use re 'debug'; when debugging regular expressions, but I'm not sure it's helpful in this case.

The usual suspects are .* or .*?, because they start by matching the whole string and then backtracking to match less. Can't you replace them with [^;]* or similar?

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: regex gotcha moving from 5.8.8 to 5.30.0?
by mordibity (Acolyte) on Feb 10, 2021 at 00:16 UTC

    Thx for the idea; I just tried it (using [^;]*? instead of .*? in the two locations) but it didn't really change the (crude) runtimes -- 5.8.8 is over twice as fast as 5.30.0 (~14sec vs ~37sec) on the fake data, and 10x as fast (~6sec vs 105sec) on the real data...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2021-04-11 20:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?