develooper Front page | perl.perl5.porters | Postings from March 2007

Re: The performance problem of 30678

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 25, 2007 15:01
Subject:
Re: The performance problem of 30678
Message ID:
20070325220127.GO5748@plum.flirble.org
On Sat, Mar 24, 2007 at 06:55:11PM +0100, Marcus Holland-Moritz wrote:
> On 2007-03-24, at 15:06:23 +0000, Nicholas Clark wrote:
> 
> > So. I don't think that the problem was quite what we thought that it was :-)
> > 
> > Are we making lots more SVs? Or are we just bumping the refcounts through the
> > roof?
> 
> I think the attached patch fixes this. The problem is
> that the loop in Perl_reg_temp_copy() ups the refcount
> of all three members of the substr struct. But the third
> member is actually just pointing to one of the others.
> So the code ups the refcount of one of these two twice,
> which causes it not to be freed later in Perl_pregfree().

Having looked at pregfree, I agree. So, thanks applied as change 30753.

and for t/op/pat.t we go from
      534.15 real       515.51 user         0.11 sys
to
       15.05 real        14.14 user         0.16 sys


However, I can now see some more things that could be done to the code and
structs...

Nicholas Clark

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