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

Re: branch prediction hints (was: faster safe signals?)

Thread Previous | Thread Next
From:
Tim Bunce
Date:
March 21, 2008 18:25
Subject:
Re: branch prediction hints (was: faster safe signals?)
Message ID:
20080321211100.GA1912@timac.local
On Fri, Mar 21, 2008 at 08:52:35PM +0000, Tim Bunce wrote:
> On Fri, Mar 21, 2008 at 12:21:53PM +0000, Nicholas Clark wrote:
> > 
> > It made me wonder. Currently the perl 5 runloop looks like this:
> > 
> > int
> > Perl_runops_standard(pTHX)
> > {
> >     dVAR;
> >     while ((PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX))) {
> > 	PERL_ASYNC_CHECK();
> >     }
> > 
> > # 3 "PERL_ASYNC_CHECK expands to"
> > if ((my_perl->Isig_pending)) Perl_despatch_signals(my_perl)
> > 
> > We do the check after every op. I wondered, if we did the check
> 
> I think there's more to gain by adding branch prediction to the code.
> It seems the config side is done, so it's ready to use:

Just to clarify that... I meant to the whole codebase, not just the runloop.
There are many branches with uneven probabilities that would benefit
from branch prediction hints.

Tim.

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