diff options
| author | drbaggy <js5@sanger.ac.uk> | 2021-05-30 08:45:51 +0100 |
|---|---|---|
| committer | drbaggy <js5@sanger.ac.uk> | 2021-05-30 08:45:51 +0100 |
| commit | 5f85b848c0c828ba9f18f6e90a388ccfab9ef17a (patch) | |
| tree | 8b4aeca6c84e038d145c5dceef383164b5ed2b08 | |
| parent | 851f8bba5dc619d89d9b0b1ca9c974f0bec609ee (diff) | |
| download | perlweeklychallenge-club-5f85b848c0c828ba9f18f6e90a388ccfab9ef17a.tar.gz perlweeklychallenge-club-5f85b848c0c828ba9f18f6e90a388ccfab9ef17a.tar.bz2 perlweeklychallenge-club-5f85b848c0c828ba9f18f6e90a388ccfab9ef17a.zip | |
changed speed test so always does 2000 iterations irrespective of range...
| -rw-r--r-- | challenge-114/james-smith/perl/ch-2.pl | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/challenge-114/james-smith/perl/ch-2.pl b/challenge-114/james-smith/perl/ch-2.pl index 589dbdc34f..c3572ec45d 100644 --- a/challenge-114/james-smith/perl/ch-2.pl +++ b/challenge-114/james-smith/perl/ch-2.pl @@ -17,18 +17,19 @@ my @sols = ( #done_testing(); my @ranges = ( - [ 4000, 1, 500 ], - [ 1000, 500, 2500 ], - #[ 100, 1_047_576, 1_049_576 ], - #[ 50, 1_073_740_824, 1_073_742_824 ], + [ 5000, 1..500,1..500,1..500,1..500 ], + [ 5000, 500..2499 ], + [ 5000, 1_047_576..1_049_575 ], + [ 5000, 1_073_740_824..1_073_742_823 ], ); foreach my $r (@ranges) { - cmpthese( $r->[0], { - 'rind2' => sub { next_bin_rindex2( $_ ) foreach $r->[1] .. $r->[2] }, - 'rind' => sub { next_bin_rrev( $_ ) foreach $r->[1] .. $r->[2] }, - 'rex' => sub { next_bin_rex( $_ ) foreach $r->[1] .. $r->[2] }, -# 'simp' => sub { next_bin( $_ ) foreach $r->[1] .. $r->[2] }, + my($c,@n) = @{$r}; + cmpthese( $c, { + 'rind2' => sub { next_bin_rindex2( $_ ) foreach @n }, + 'rind' => sub { next_bin_rrev( $_ ) foreach @n }, + 'rex' => sub { next_bin_rex( $_ ) foreach @n }, +# 'simp' => sub { next_bin($_ ) foreach @n }, }); } |
