When the code is evalled, your lexical $string is not in scope, so all these tests are running against undef.
If I change the declaration to our $string, and refer to $::string within all the evals I get:
which seems more reasonable.Rate tr_loop eq_loop tr eq tr_loop 96844/s -- -26% -96% -98% eq_loop 130666/s 35% -- -95% -97% tr 2436420/s 2416% 1765% -- -41% eq 4137436/s 4172% 3066% 70% --
Hugo
In reply to Re: tr faster than eq?
by hv
in thread tr faster than eq?
by Keystroke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |