develooper Front page | perl.perl5.porters | Postings from January 2018

EXACTFish matching in regexec.c find_byclass() is a waste?

Thread Next
Karl Williamson
January 31, 2018 14:28
EXACTFish matching in regexec.c find_byclass() is a waste?
Message ID:
The way folded EXACTFish nodes appear to me to work currently is that 
when we get to a position in the matching that we go through the string 
in the node, folding the target string and comparing.  If this works we 
call regtry() which calls regmatch() that, in the process of checking 
everything matches, does the same thing again.

Is there a reason to not just generate a synthetic start class which 
contains the union of all possible first bytes the node could match? 
Then we scan for one of those bytes, check that there's enough length 
left in the target string to match, and then call regtry.  Thus we would 
call regtry potentially more often, but we avoid reparsing and refolding 
the string.  And that seems like a big win to me.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About