Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: Efficient matching with accompanying data (${^RE_TRIE_MAXBUF})

by LanX (Chancellor)
on Jul 11, 2013 at 13:39 UTC ( #1043727=note: print w/replies, xml ) Need Help??

in reply to Re^2: Efficient matching with accompanying data
in thread Efficient matching with accompanying data

> Given that timing I suspect the trie optimization was not used.

Sure, see also ${^RE_TRIE_MAXBUF} in perlvar

${^RE_TRIE_MAXBUF} Controls how certain regex optimisations are applied an +d how much memory they utilize. This value by default is 6553 +6 which corresponds to a 512kB temporary cache. Set this to a h +igher value to trade memory for speed when matching large alternations. Set it to a lower value if you want the optimisations to be as conservative of memory as possib +le but still occur, and set it to a negative value to prevent +the optimisation and conserve the most memory. Under norma +l situations this variable should be of no interest to yo +u.

Disabling the buffer is also a mean to show the effect of a missing optimization.

It's also much faster to join all strings to be inspected on the LHS and to run the regex just once.

But if only word-boundaries are needed, I suppose hash-lookups can still be faster, of course depending on "density" and "distance" of the searched patterns.

Cheers Rolf

( addicted to the Perl Programming Language)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043727]
Corion idly wonders about creating a series of HTTP requests. There seems to be no framework to generate a series of HTTP requests, like "try all these requests"
[Corion]: This is vaguely inspired by that list of "nasty" strings, which I'd like to replace among HTTP parameters, just to see whether the application crashes, but also for easy downloading of a list of URLs etc

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-01-16 15:36 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (151 votes). Check out past polls.