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

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

Thread Next
From:
Karl Williamson
Date:
January 31, 2018 14:28
Subject:
EXACTFish matching in regexec.c find_byclass() is a waste?
Message ID:
5d472e88-0175-a2be-bd6f-05326139623e@khwilliamson.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About