in reply to Re: Benchmarking "Are all these characters in this sentence?" (quickest yet?)
in thread Benchmarking "Are all these characters in this sentence?"
Aha, found it. $_ isn't localized, so using it that way trashes the array. @#$%@#$.
buk => sub { my( $s, $w ) = @_; my $c; 1+index $s, $c or return 0 while $c = chop $w; 1; }, works just fine.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Benchmarking "Are all these characters in this sentence?" (quickest yet?)
by BrowserUk (Patriarch) on Aug 30, 2008 at 20:14 UTC | |
Does this change things?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
by RMGir (Prior) on Aug 30, 2008 at 20:26 UTC | |
$_ is a bit scary sometimes, it's auto-scoped so often that it's hard to remember it isn't alway so... Mike | [reply] |
by BrowserUk (Patriarch) on Aug 30, 2008 at 21:51 UTC | |
Of course, we then apply the so called "micro optimisations" to that:
Though the results of doing so can harldy be called "micro" when they result in an order of magnitude speed up over the non-optimised equivalent; 15 times faster than the next best; and 60 times faster than the original!
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
by BrowserUk (Patriarch) on Aug 30, 2008 at 21:51 UTC | |
Of course, we can then apply the so called "micro optimisations" to that:
Though the results of doing so can hardly be called "micro" when they result in an order of magnitude speed up over the non-optimised equivalent; 15 times faster than the next best; and 60 times faster than the original!
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |