# New Ticket Created by  Calvin Schwenzfeier 
# Please include the string:  [perl #128055]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128055 >


>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

Reply via email to