develooper Front page | perl.perl6.internals | Postings from November 2002

Re: [CVS ci] string_set is back for a faster live - not only

Thread Previous | Thread Next
From:
Leopold Toetsch
Date:
November 6, 2002 13:02
Subject:
Re: [CVS ci] string_set is back for a faster live - not only
Message ID:
3DC9830A.7030307@toetsch.at
Dan Sugalski wrote:


> Substr should generate a new string and stick that into S0.
> 
> If we want to build a fast version that reuses a string register, I'm 
> fine with that--it's definitely useful in a large number of 
> circumstances, large enough to warrant expressing both sets of semantics.

Fine. But how do we know, which version we could take. Please read again 
Peter's example. It depends on the semantics of Sx register usage all 
over the program IMHO.

My version doesn't break any current test but gives ~30% increase in 
life generations - yes I do know - 1): correctness, 2) speed - but what 
is correct for Peter's example?

The "normal" case would be that substr (or any operation resulting in a 
new Sx) should be able to reuse an existing string header. Peter's 
example is a of course valid but still exception from a normal program 
flow IMHO. If I (HL) want to save a SReg, I would copy (clone in PMC 
terms) it.

I think, we should invest some more thoughts on an optimization with 
that much potential in execution speed. DOD/GC runs aren't free, when 
minimized we can gain ~30% execution speed.

And for RL (or perl6) programs, reusign PMCs would be a similar case.

leo


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