use Benchmark qw(cmpthese); my ($a, $b) = (0,0); my $limit = 10_000; sub f1 { ++$a < $limit ? goto &f1 : return $a} sub f2 {{ ++$b < $limit ? redo : return $b }} cmpthese -1, { f1 => \&f1, f2 => \&f2 };