grep-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grep-devel] proposed new function for dfa


From: arnold
Subject: Re: [Grep-devel] proposed new function for dfa
Date: Tue, 22 Nov 2016 23:43:57 -0700
User-agent: Heirloom mailx 12.4 7/29/08

Hi Paul.

> Why check whether TO and FROM are non-null?

Why not? Or is a core dump better?  (Serious question.)

> > +    {
> > +       memset (to, 0, offsetof (struct dfa, dfaexec));
>
> This does more than copy syntax from FROM to TO. It also clears out the 
> rest of TO. Is that the intent?

No. I'll remove it. It came along from dfasyntax.

> How does the function help improve gawk's performance?

Consider:

        $1 ~ $2 { .... }

The second field on each line is compiled as a regexp, for every line.
There's no reason to recompute all the syntax settings every time since
the syntax bits don't change over any given invocation of gawk.

There are other cases as well.

> I looked in savannah gawk master but didn't see this function, so I
> guess you're using it in some non-published work.

Getting ready to include it. I wanted review of the dfa changes by the
grep team first.

Thanks,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]