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

RFC what about long regex EXACT nodes

Thread Next
From:
Karl Williamson
Date:
September 11, 2019 05:20
Subject:
RFC what about long regex EXACT nodes
Message ID:
a43b9016-2763-704b-a9d0-73d68a31578d@khwilliamson.com
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?

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