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

[PATCH] shift; optimization

Thread Next
From:
Ruslan Zakirov
Date:
April 15, 2010 17:23
Subject:
[PATCH] shift; optimization
Message ID:
x2t589c94401004151723oa6bc4e54ua1deb4a0b774c0b1@mail.gmail.com
Hello,

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About