This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/perf/benchmarks: add a few sub and goto tests
authorDavid Mitchell <davem@iabyn.com>
Thu, 2 Jul 2015 09:14:14 +0000 (10:14 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:34 +0000 (08:59 +0000)
t/perf/benchmarks

index fa7b54c..550c797 100644 (file)
 
 
 [
-    'call::sub::3_args' => {
+    'call::sub::empty' => {
+        desc    => 'function call with no args or body',
+        setup   => 'sub f { }',
+        code    => 'f()',
+    },
+    'call::sub::args3' => {
         desc    => 'function call with 3 local lexical vars',
-        setup   => 'sub f { my ($a, $b, $c) = @_ }',
+        setup   => 'sub f { my ($a, $b, $c) = @_; 1 }',
+        code    => 'f(1,2,3)',
+    },
+    'call::sub::args3_ret3' => {
+        desc    => 'function call with 3 local lex vars and 3 return values',
+        setup   => 'my @a; sub f { my ($a, $b, $c) = @_; $a+$b, $c, 1 }',
+        code    => '@a = f(1,2,3)',
+    },
+
+    'call::goto::empty' => {
+        desc    => 'goto &funtion with no args or body',
+        setup   => 'sub f { goto &g } sub g {}',
+        code    => 'f()',
+    },
+    'call::goto::args3' => {
+        desc    => 'goto &funtion with 3 local lexical vars',
+        setup   => 'sub f { goto &g } sub g { my ($a, $b, $c) = @_ }',
         code    => 'f(1,2,3)',
     },