This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: clarify how undeffing HV/AV is faster now
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Sat, 13 May 2017 22:14:50 +0000 (22:14 +0000)
committerÆvar Arnfjörð Bjarmason <avar@cpan.org>
Wed, 17 May 2017 14:51:19 +0000 (14:51 +0000)
There were better notes in the change that introduced this[1]. Copy
the performance numbers from there, and say "arrays and
hashes". instead of "AV and HV". Better to use the more familiar names
than the internal struct names which are mostly only familiar to core
devs.

1. be98855787 ("speed up AV and HV clearing/undeffing", 2016-10-26)

pod/perldelta.pod

index ef8a193..67a1df0 100644 (file)
@@ -332,7 +332,22 @@ Enhancements in Regex concat COW implementation.
 
 =item *
 
-Speed up C<AV> and C<HV> clearing/undeffing.
+Clearing hashes and arrays has been made slightly faster. Now code
+like this is around 5% faster:
+
+    my @a;
+    for my $i (1..3_000_000) {
+        @a = (1,2,3);
+        @a = ();
+    }
+
+and this code around 3% faster:
+
+    my %h;
+    for my $i (1..3_000_000) {
+        %h = qw(a 1 b 2);
+        %h = ();
+    }
 
 =item *