develooper Front page | perl.perl5.porters | Postings from April 2010

[PATCH] shift; optimization

Thread Next
Ruslan Zakirov
April 15, 2010 17:23
[PATCH] shift; optimization
Message ID:

In attachements you can find two patches that avoid using two
additional OPs for shift and pop without argument. In the current
blead ck_shift rebuilds the OP in this case and adds RV2AV(GV(@_ or
@ARGV)) chain. Patches change that and use OPf_SPECIAL flag instead. I
wrote two variants:

1) For @ARGV case old approach is used
2) op_private is used to choose between @ARGV and @_ later

I prefer first variant, but it's up to you to decide:
1) the first variant drops two pp_* calls per shift; and adds &+if in pp_shift
2) the second drops the same two pp_* calls, but in all cases, however
adds another &+if pair in pp_shift

As shift; acting on @ARGV is limitted to scripts only then I don't
think it worth to optimize tree size.

Best regards, Ruslan.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About