in reply to Benchmarking "Are all these characters in this sentence?"
Try this:
buk => sub { my( $s, $w ) = @_; 1+index $s, $_ or return while $_ = chop $w; 1; },
In a cursory test it seems to be about twice as fast as the best of tye's in all cases.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Benchmarking "Are all these characters in this sentence?" (quickest yet?)
by RMGir (Prior) on Aug 30, 2008 at 20:01 UTC | |
by BrowserUk (Patriarch) on Aug 30, 2008 at 20:14 UTC | |
by RMGir (Prior) on Aug 30, 2008 at 20:26 UTC | |
by BrowserUk (Patriarch) on Aug 30, 2008 at 21:51 UTC | |
by BrowserUk (Patriarch) on Aug 30, 2008 at 21:51 UTC |