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

Re: OP_SIGNATURE

Thread Previous | Thread Next
From:
perl
Date:
March 3, 2015 22:02
Subject:
Re: OP_SIGNATURE
Message ID:
54F62F61.5070501@profvince.com

>
> pp_padrange() just pushes a mark, a consecutive range of pad SVs, and
> optionally another mark and the elements of @_ onto the stack. The
> actual assignment is done by pp_aassign() as normal.
>
 > ...
>
> This is why for this code  (as I mentioned in my original announcement):
>
>      sub f { my ($a, $b, $c) = @_;1 }
>      my $self = {};
>      f($self,1,2) for 1..N;
>
> comparing vanilla perl with a perl compiled with -DPERL_FAKE_SIGNATURE,
> for 1 complete call of that sub, including:
>      pushing a mark, $self, 1, 2, *f onto the stack,
>      calling pp_enterub,
>      calling pp_nextstate,
>      calling pp_padrange+pp_aassign or pp_signature
>      another pp_nextstate;
>      pp_const();
>      pp_leavesub()
>
> the number of x86_64 CPU instructions executed with pp_padrange+pp_aassign
> is 1492, while with pp_signature, it drops to 1119, a saving of 25%.
> And that's for the whole function call overhead, not just executing
> pp_signature verses pp_padrange+pp_aassign.
>

Thank you for your answer. I definitely missed the fact that padrange 
did not implement aassign.


Vincent

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