in reply to Re^12: Specializing Functions with Currying
in thread Specializing Functions with Currying
Weird.
use Benchmark qw(cmpthese); use List::Util qw(first); @_= ( (0)x1000, 1, (0)x8999 ); cmpthese -1, { func => sub { first { $_ == 1 } @_ }, imper => sub { for ( @_ ) { next unless $_ == 1; return $_ } }, } __END__ Rate imper func imper 518950/s -- -20% func 649177/s 25% --
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^14: Specializing Functions with Currying
by BrowserUk (Patriarch) on Aug 09, 2004 at 15:07 UTC | |
by Aristotle (Chancellor) on Aug 09, 2004 at 15:50 UTC | |
by BrowserUk (Patriarch) on Aug 09, 2004 at 16:10 UTC | |
by Aristotle (Chancellor) on Aug 09, 2004 at 16:27 UTC |