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

Re: [perl #133352] Ancient Regex Regression

Thread Previous | Thread Next
From:
Deven T. Corzine
Date:
July 26, 2018 13:53
Subject:
Re: [perl #133352] Ancient Regex Regression
Message ID:
25563_1532613185_5B59D241_25563_13_1_CAFVdu0S2c5pHrYNf0rDfB-3Qf2ZYNhK1ZjrHFZMEQ8mi02Rd_A@mail.gmail.com
On Mon, Jul 23, 2018 at 11:40 AM, David Nicol <davidnicol@gmail.com> 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
separately.

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...

Deven

Thread Previous | 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