This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make assignment over glob copies much faster
authorFather Chrysostomos <sprout@cpan.org>
Thu, 24 Nov 2011 09:09:14 +0000 (01:09 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 24 Nov 2011 09:45:32 +0000 (01:45 -0800)
commit804b5ed7b6140d5110359c81438a8dea7f5b0e04
treec0fec147f59026fa9ee470d8e6e9e50a3303c436
parent5668452f0dfcb2591dfb8da07389b99e8823a280
Make assignment over glob copies much faster

sv_force_normal is passed the SV_COW_DROP_PV flag if the scalar is
about to be written over.  That flag is not currently used.  We can
speed up assignment over fake GVs a lot by taking advantage of the flag.

Before and after:

$ time ./perl -e '$x = *foo, undef $x for 1..2000000'

real 0m4.264s
user 0m4.248s
sys 0m0.007s
$ time ./perl -e '$x = *foo, undef $x for 1..2000000'

real 0m1.820s
user 0m1.812s
sys 0m0.005s
embed.fnc
embed.h
proto.h
sv.c