Open p6rt opened 8 years ago
From the #perl6 channel:
cschwenz 8:46 p6: class Foo { multi method aaa() { my Int $y = 0; }; multi method aaa(Int $x = 1) { my Int $y = $x; }; }; my Instant $t1 = now; for (1 .. 10000) { Foo.aaa() }; my Instant $t2 = now; my $d1 = ( $t2 - $t1 ).narrow; say "$d1"; camelia 8:46 rakudo-moar ef3e62: OUTPUT«0.00490609»
cschwenz 8:46 p6: class Foo { multi method aaa() { my Int $y = 0; }; multi method aaa(Int $x where $x > 0 = 1) { my Int $y = $x; }; }; my Instant $t1 = now; for (1 .. 10000) { Foo.aaa() }; my Instant $t2 = now; my $d1 = ( $t2 - $t1 ).narrow; say "$d1"; camelia 8:46 rakudo-moar ef3e62: OUTPUT«0.31616794»
Of note, the "where" restriction is placed on the multi-method which is *not* called.
Hope that helps, ~Cal
Migrated from rt.perl.org#128055 (status was 'new')
Searchable as RT128055$