/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
50,00011.533.64127,440417  72% 78% 93% 75%
500,00021.406.58297,692417  75% 84% 89% 78%
5,000,00058.2821.452,151,328417  65% 63% 63% 82%

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

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

 regex-dna Ruby JRuby #2 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

seq = STDIN.readlines.join
ilen = seq.size

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

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/
]

threads = MATCHERS.map do |f|
  Thread.new do
    Thread.current[:result] = "#{f.source} #{seq.scan(f).size}"
  end
end

threads.each do |t|
  t.join
end

match_results = threads.map do |t|
  t[:result]
end

{
  '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)'
}.each { |f,r| seq.gsub!(f,r) }

puts "#{match_results.join("\n")}\n\n#{ilen}\n#{clen}\n#{seq.length}"

 make, command-line, and program output logs

Sun, 30 Mar 2014 03:09:31 GMT

MAKE:
mv regexdna.jruby-2.jruby regexdna.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 regexdna.rb 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