in reply to Re^2: find combinations
in thread find combinations
so it constructs the same data-structure in all cases and then I gettimethese (-10, { 'tye' => sub { $iter = find_lances_tye ( \%mechs, 5, 240, 10 ); while ( my $lance = $iter->() ) { push @tye, join (",", sort @{$lance->{names}}) . "(" . + $lance->{weight} . " tons)\n" ; } @tye = sort @tye; }, 'holli' => sub { @holli = find_lances_holli (5, 240, 10, keys %mechs ); @holli = map { join (",", sort @{$_->{names}}) . "(" . $_- +>{weight} . " tons)\n" } @holli; @holli = sort @holli; }, 'demerphq' => sub { @demerphq = find_lances_demerphq ( \%mechs, 5, 240, 10 ); @demerphq = map { join (",", sort @{$_->{names}}) . "(" . +$_->{weight} . " tons)\n" } @demerphq; @demerphq = sort @demerphq; }, } );
Pretty similar to your outcome. Thanks for the clarification.C:\>benchmark.pl Benchmark: running demerphq, holli, tye for at least 10 CPU seconds... demerphq: 10 wallclock secs (10.41 usr + 0.02 sys = 10.42 CPU) @ 1 +.44/s (n=15) holli: 12 wallclock secs (12.23 usr + 0.00 sys = 12.23 CPU) @ 0 +.33/s (n=4) tye: 10 wallclock secs (10.33 usr + 0.02 sys = 10.34 CPU) @ 1 +.84/s (n=19)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: find combinations
by demerphq (Chancellor) on Sep 07, 2005 at 13:56 UTC |