in reply to tr faster than eq?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tr faster than eq?
by Keystroke (Scribe) on Mar 10, 2005 at 18:37 UTC | |
|
Re^2: tr faster than eq?
by Anonymous Monk on Mar 11, 2005 at 09:15 UTC |