Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You're using a constant input which starts with a "3" though, which unfairly penalizes test1 and test2 (it's the final situation they check for). For inputs starting with a "1", test3 is still the fastest, but the difference between it and the other tests is much smaller. Also, I'd recommend running your benchmarks like this:
... using q{ ... } instead of sub { ... }. If you use sub { ... } you're wrapping each iteration in an extra sub call layer. For micro-optimization benchmarks like this, that extra layer can make a significant difference to the results.
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
In reply to Re^4: Given When Syntax
by tobyink
|
|