develooper Front page | perl.perl5.porters | Postings from October 2014

Re: Single-item padrange?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
October 13, 2014 10:21
Subject:
Re: Single-item padrange?
Message ID:
20141013102051.GW5204@iabyn.com
On Sat, Oct 11, 2014 at 08:27:26AM -0000, Father Chrysostomos wrote:
> $ ./perl -Ilib -MO=Concise -e 'join my $foo, @_;'
> 7  <@> leave[1 ref] vKP/REFC ->(end)
> 1     <0> enter ->2
> 2     <;> nextstate(main 1 -e:1) v:{ ->3
> 6     <@> join[t4] vK/2 ->7
> 3        <0> padrange[$foo:1,2] s/LVINTRO,1 ->4
> -        <0> padsv[$foo:1,2] sM/LVINTRO ->4
> 5        <1> rv2av[t3] lK/1 ->6
> 4           <#> gv[*_] s ->5
> -e syntax OK
> 
> What is that padrange for?  Isn't a single padrange slower than a
> padsv?  Shouldn't we skip padrange for just 1 var?  (Or 2 maybe?)

IIRC, I was thinking that it saves the overhead of a call to pp_pushmark;
but whether that compensates for the extra overhead in pp_padrange and
leave_scope(), I don't know (but suspect not). It probably needs
cachegrinding to find out.

-- 
Standards (n). Battle insignia or tribal totems.

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