Help for this page

Select Code to Download


  1. 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]}}";
    
  2. or download this
    real    0m22.596s
    user    0m21.530s
    sys    0m1.045s
    
  3. 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];
    
  4. or download this
    real    0m4.322s
    user    0m27.992s
    sys    0m0.170s
    
  5. 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]} }
    
  6. or download this
    Sets: 659,948
    Gets: 16,261,635