Some repeated benchmarking answers this . . .
my is expensive. Removing the my and making $strlen a global eliminates the diferrence for the small test case. The bench about the same. Multiplying the length of the test string by ten and leaving $strlen global gives thelenm's sub big gains over the orginal - %6-%10. Finally, making $strlen lexical and retesting reduces those gains by %4-%8, still testing with "Just Another Perl Hacker,"x10.
So, yes, this is definately an optimization.
Cheers,In reply to Re: Re: Re: Finding all substrings
by erikharrison
in thread Finding all substrings
by TheHobbit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |