This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Better optimise my/local @a = split()
[perl5.git] / t / perf / benchmarks
index 3daa27d..f02a06a 100644 (file)
         setup   => 'my @a; my $s = "abc:def";',
         code    => '@a = split /:/, $s, 2;',
     },
-
     'func::split::myarray' => {
         desc    => 'split into a lexical array declared in the assign',
         setup   => 'my $s = "abc:def";',
         code    => 'my @a = split /:/, $s, 2;',
     },
+    'func::split::arrayexpr' => {
+        desc    => 'split into an @{$expr} ',
+        setup   => 'my $s = "abc:def"; my $r = []',
+        code    => '@$r = split /:/, $s, 2;',
+    },
 
 
     'loop::block' => {