bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Increased RAM memory usage in gawk 5.0.1 compared to gawk


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Increased RAM memory usage in gawk 5.0.1 compared to gawk 4.1.4
Date: Mon, 12 Aug 2019 10:34:39 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Aug 12, 2019 at 08:12:00AM -0600, address@hidden wrote:
> "Andrew J. Schorr" <address@hidden> wrote:
> 
> > On Sun, Aug 11, 2019 at 07:42:37AM -0600, address@hidden wrote:
> > > BTW, your change to disable the 4.2 IGNORECASE speed-up is fine for your
> > > program, which doesn't use IGNORECASE, but is wrong for the general
> > > case, so I cannot include it in the code base.
> >
> > Mightn't it be possible to stop populating re_reg[1] with the ignorecase
> > variant when the node is created and instead populate it only when needed?
> > As far as I can tell from a cursory inspection, the only place that 
> > re_reg[IGNORECASE]
> > is accessed is from re.c:re_update. Could it make sense then to populate the
> > regexps on a lazy basis from that function when they are needed? I guess
> > this could be done for both the regular and IGNORECASE variants, but maybe
> > the regexp needs to be compiled initially to give timely error messages...
> >
> > Regards,
> > Andy
> 
> I have been thinking along the same lines.  That would help with the
> space issue.

Agreed. Attached is a patch to master that more or less works, I think.
There are some issues in make check because the error reporting differs
as a result of the lazy evaluation (I think). I'm slightly nervous about
the next-to-last argument to make_regexp in _cache_get. I don't have
time to dig in deeper right now.

> I am right now trying to track down the reason that the execution
> time is so much greater; I don't think it's related to IGNORECASE
> change.

Fair enough. This is just a hack that may help in some cases. I suspect
that most people don't use IGNORECASE.

Regards,
Andy

Attachment: lazy_regexp.patch
Description: Text document


reply via email to

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