- or download this
#!/usr/bin/perl
use strict;
...
@long_seqs = sort { $b->[1] <=> $a->[1]} @long_seqs;
say "$_->[0]: $_->[1]" for @long_seqs[0..19];
# say "@{$cache{$long_seqs[0][0]}}";
- or download this
real 0m22.596s
user 0m21.530s
sys 0m1.045s
- or download this
use strict; use warnings; use feature 'say';
use Data::Dumper;
...
@output = sort { $b->[1] <=> $a->[1] } @output;
say sprintf('%s : length %s', $_->[0], $_->[1]) for @output[0..19];
- or download this
real 0m4.322s
user 0m27.992s
sys 0m0.170s
- or download this
my %cache;
my $sets = my $gets = 0;
sub cache_has { $gets++; exists $cache{$_[0]} }
sub cache_set { $sets++; $cache{$_[0]} = $_[1] }
sub cache_get { $gets++; $cache{$_[0]} }
- or download this
Sets: 659,948
Gets: 16,261,635