develooper Front page | perl.perl5.porters | Postings from September 2019

Re: RFC what about long regex EXACT nodes

Thread Previous | Thread Next
September 11, 2019 09:25
Re: RFC what about long regex EXACT nodes
Message ID:
On Wed, 11 Sep 2019, 07:20 Karl Williamson, <> wrote:

> Currently if there is a long string of text that is to be matched
> exactly (or under /i) that data is chunked into pieces of at most 256
> bytes.  The reason for this limit is that there happen to be 8 bits
> available.
> But why not have a new node type for longer strings which wasn't limited
> to 256 bytes.  Is there a reason we haven't done this other than lack of
> tuits?
> The advantages of such a node are less overhead when matching, as you
> can just keep going longer in the matching loop, and your memcmp for
> exact matches will be a single one rather than multiple.
> I don't know if the optimizer currently strings such nodes together when
> computing the min and maximum lengths for strings to be able to match.
> It may be that it stops at 256.  If so this would improve the ability to
> avoid matching trivially if the criteria weren't met.
> So is there a reason not to have this?

I think this sounds reasonable.



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