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

Re: [perl #133352] Ancient Regex Regression

Thread Previous | Thread Next
Deven T. Corzine
July 26, 2018 13:53
Re: [perl #133352] Ancient Regex Regression
Message ID:
On Mon, Jul 23, 2018 at 11:40 AM, David Nicol <> wrote:
> how much performance impact would using a linked-list for every capture
> have, to facilitate the rollback? Or, to stay within perl data, use an array
> structure: instead of clobbering, unshift; roll back by shifting; at the
> very end assign from [0] elements of all internal capture arrays. Captures
> syntactically impossible to roll back (are there any?) would be exempt,
> backreferences would refer to the current [0] elt of each capture array, or
> the head of each capture linked-list.

Perl's high-level data structures would be too slow to make sense
here.  Perl already uses slab allocation for other data structures,
including for the regex engine, and if this couldn't be done with the
existing ones, a new one could be made.  Slab allocation is much
faster than a straightforward inked list where you malloc() each node

Regardless, I've also been wondering if saving captures a different
way like this would be better.  I'm not sure offhand, but I believe
it's worth looking into...


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