performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
50,0000.440.445,956343  0% 0% 2% 100%
500,0003.783.7915,092343  0% 1% 1% 100%
5,000,00037.3437.36152,664343  0% 1% 1% 100%

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

Read regex-dna benchmark to see what this program should do.

 notes

ruby 2.1.5p273 (2014-11-13 revision 48405) [i686-linux]

 regex-dna Ruby #5 program source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org
#
# contributed by jose fco. gonzalez
# optimized & parallelized by Rick Branson
# optimized for ruby2 by Aaron Tavistock
# optimized more by Utkarsh Kukreti

MATCHERS = [
  /agggtaaa|tttaccct/,
  /[cgt]gggtaaa|tttaccc[acg]/,
  /a[act]ggtaaa|tttacc[agt]t/,
  /ag[act]gtaaa|tttac[agt]ct/,
  /agg[act]taaa|ttta[agt]cct/,
  /aggg[acg]aaa|ttt[cgt]ccct/,
  /agggt[cgt]aa|tt[acg]accct/,
  /agggta[cgt]a|t[acg]taccct/,
  /agggtaa[cgt]|[acg]ttaccct/
]

seq = STDIN.read
ilen = seq.size

seq.gsub!(/>.*\n|\n/,"")
clen = seq.length

MATCHERS.each do |m|
  puts "#{m.source} #{seq.scan(m).size}"
end

hash = {
  'B' => '(c|g|t)', 
  'D' => '(a|g|t)', 
  'H' => '(a|c|t)', 
  'K' => '(g|t)',
  'M' => '(a|c)', 
  'N' => '(a|c|g|t)', 
  'R' => '(a|g)', 
  'S' => '(c|t)',
  'V' => '(a|c|g)', 
  'W' => '(a|t)', 
  'Y' => '(c|t)'
}

seq.gsub!(/B|D|H|K|M|N|R|S|V|W|Y/, hash)

puts
puts ilen
puts clen

puts seq.length

 make, command-line, and program output logs

Fri, 14 Nov 2014 23:15:40 GMT

COMMAND LINE:
/usr/local/src/ruby/bin/ruby regexdna.yarv-5.yarv 0 < regexdna-input5000000.txt

PROGRAM OUTPUT:
agggtaaa|tttaccct 356
[cgt]gggtaaa|tttaccc[acg] 1250
a[act]ggtaaa|tttacc[agt]t 4252
ag[act]gtaaa|tttac[agt]ct 2894
agg[act]taaa|ttta[agt]cct 5435
aggg[acg]aaa|ttt[cgt]ccct 1537
agggt[cgt]aa|tt[acg]accct 1431
agggta[cgt]a|t[acg]taccct 1608
agggtaa[cgt]|[acg]ttaccct 2178

50833411
50000000
66800214

Revised BSD license

  Home   Conclusions   License   Play