performance measurements

Each table row shows performance measurements for this Perl program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
250,000Failed  472   

Read the ↓ make, command line, and program output logs to see how this program was run.

Read k-nucleotide benchmark to see what this program should do.

 notes

This is perl 5, version 18, subversion 0 (v5.18.0) built for x86_64-linux

Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
                        USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
                        USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF

 k-nucleotide Perl #4 program source code

# The Computer Language Benchmarks Game
#  http://benchmarksgame.alioth.debian.org/
#
#  contributed by Mykola Zubach

use strict;
use integer;
use threads;

my($sequence, $seq_len, $thr, @threads, %h);

sub count_frame {
   my $len = shift;
   for (0 .. $seq_len - $len) {
      $h{substr($sequence, $_, $len)} ++;
   }
}

sub count_len {
   my $len = shift;
   my $out;
   count_frame($len);

   no integer;
   if(@_) {
      $out = join '', map sprintf("%d\t%s\n", $h{$_}, $_), @_;
   } else {
      my $sum = $seq_len - $len + 1;
      for (sort { $h{$b} <=> $h{$a} || $a cmp $b } keys %h) {
         $out .= sprintf "%s %.3f\n", $_, $h{$_} * 100 / $sum;
      }
      $out .= "\n";
   }
   return $out;
}

## MAIN()

while(<STDIN>) {
   last if /^>THREE /;
}
while(<STDIN>) {
   last if /^>/;
   chomp;
   $sequence .= uc;
}
$seq_len = length($sequence);

for (1,2) {
   push @threads, threads->create(\&count_len, $_);
}

for (qw(GGT GGTA GGTATT GGTATTTTAATT GGTATTTTAATTTATAGT)) {
   push @threads, threads->create(\&count_len, length, $_);
}

foreach $thr (@threads) {
   print $thr->join();
}

 make, command-line, and program output logs

Tue, 14 Jan 2014 21:24:51 GMT

COMMAND LINE:
/usr/local/src/perl-5.18.0_no_ithreads_no_multi/bin/perl knucleotide.perl-4.perl 0 < knucleotide-input250000.txt

PROGRAM FAILED 


PROGRAM OUTPUT:

This Perl not built to support threads
Compilation failed in require at knucleotide.perl-4.perl line 8.
BEGIN failed--compilation aborted at knucleotide.perl-4.perl line 8.

Revised BSD license

  Home   Conclusions   License   Play