/mobile Handheld Friendly website

 performance measurements

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

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

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

jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) Server VM 1.8.0-b132 +indy [linux-i386]

 k-nucleotide Ruby JRuby #2 program source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org
#
# contributed by jose fco. gonzalez
# modified by Sokolov Yura

seq = String.new

def frecuency( seq,length )
    n, table = seq.length - length + 1, Hash.new(0)
    f, i = nil, nil
    (0 ... length).each do |f|
        (f ... n).step(length) do |i|
            table[seq[i,length]] += 1
        end
    end
    [n,table]

end

def sort_by_freq( seq,length )
    n,table = frecuency( seq,length )
    a, b, v = nil, nil, nil
    table.sort{|a,b| b[1] <=> a[1]}.each do |v|
        puts "%s %.3f" % [v[0].upcase,((v[1]*100).to_f/n)]
    end
    puts
end

def find_seq( seq,s )
    n,table = frecuency( seq,s.length )
    puts "#{table[s].to_s}\t#{s.upcase}"
end

line = STDIN.gets while line !~ /^>THREE/[
line = STDIN.gets
while (line !~ /^>/) & line do
    seq << line.chomp
    line = STDIN.gets
end

[1,2].each {|i| sort_by_freq( seq,i ) }

%w(ggt ggta ggtatt ggtattttaatt ggtattttaatttatagt).each{|s| find_seq( seq,s) }

 make, command-line, and program output logs

Sat, 29 Mar 2014 17:44:28 GMT

MAKE:
mv knucleotide.jruby-2.jruby knucleotide.rb
0.01s to complete and log all make actions

COMMAND LINE:
/usr/local/src/jruby-1.7.11/bin/jruby -Xcompile.invokedynamic=true -J-server -J-Xmn512m -J-Xms2048m -J-Xmx2048m knucleotide.rb 0 < knucleotide-input250000.txt

PROGRAM FAILED 


PROGRAM OUTPUT:

SyntaxError: knucleotide.rb:37: syntax error, unexpected kWHILE
while (line !~ /^>/) & line do
     ^

Revised BSD license

  Home   Conclusions   License   Play