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,0009.053.26336,216417  78% 67% 71% 65%
500,000Bad Output  417   

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 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) Server VM 25.45-b02 on 1.8.0_45-b14 +jit [linux-i386]

 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

Tue, 19 May 2015 10:28:52 GMT

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

COMMAND LINE:
/usr/local/src/jruby-9.0.0.0.pre2/bin/jruby -Xcompile.invokedynamic=true -J-server -J-Xmn512m -J-Xms2048m -J-Xmx2048m regexdna.rb 0 < regexdna-input500000.txt

UNEXPECTED OUTPUT 

3,6c3,6
< 
< 
< 
< 
---
> a[act]ggtaaa|tttacc[agt]t 426
> ag[act]gtaaa|tttac[agt]ct 290
> agg[act]taaa|ttta[agt]cct 536
> aggg[acg]aaa|ttt[cgt]ccct 153
8,9c8,9
< 
< 
---
> agggta[cgt]a|t[acg]taccct 160
> agggtaa[cgt]|[acg]ttaccct 219

PROGRAM OUTPUT:
agggtaaa|tttaccct 36
[cgt]gggtaaa|tttaccc[acg] 125




agggt[cgt]aa|tt[acg]accct 143



5083411
5000000
6678892

Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Exception in thread "Ruby-0-Thread-10: regexdna.rb:8" java.lang.OutOfMemoryError: Java heap space
	at org.jruby.util.ByteList.<init>(ByteList.java:91)
	at org.jruby.util.ByteList.dup(ByteList.java:325)
	at org.jruby.util.ByteList.dup(ByteList.java:297)
	at org.jruby.RubyString.modify(RubyString.java:901)
	at org.jruby.RubyString.resize(RubyString.java:976)
	at org.jruby.RubyString.freeze(RubyString.java:5360)
	at org.jruby.RubyRegexp.createMatchData(RubyRegexp.java:1541)
	at org.jruby.RubyRegexp.createMatchData19(RubyRegexp.java:1670)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1638)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1554)
	at org.jruby.RubyString.patternSearch(RubyString.java:3770)
	at org.jruby.RubyString.scanOnce(RubyString.java:3721)
	at org.jruby.RubyString.scan19(RubyString.java:3689)
	at java.lang.invoke.LambdaForm$DMH/2547507.invokeVirtual_L4_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$BMH/29847974.reinvoke(LambdaForm$BMH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$MH/27654272.linkToCallSite(LambdaForm$MH)
	at regexdna.RUBY$block$\=regexdna\,rb$1(regexdna.rb:28)
	at java.lang.invoke.LambdaForm$DMH/14655327.invokeStatic_L7_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$MH/17337681.invokeExact_MT(LambdaForm$MH)
	at org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:68)
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:69)
	at org.jruby.runtime.Block.call(Block.java:106)
	at org.jruby.RubyProc.call(RubyProc.java:319)
	at org.jruby.RubyProc.call(RubyProc.java:232)
	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
	at java.lang.Thread.run(Thread.java:745)
Exception in thread "Ruby-0-Thread-7: regexdna.rb:8" java.lang.OutOfMemoryError: Java heap space
	at org.jruby.util.ByteList.<init>(ByteList.java:91)
	at org.jruby.util.ByteList.dup(ByteList.java:325)
	at org.jruby.util.ByteList.dup(ByteList.java:297)
	at org.jruby.RubyString.modify(RubyString.java:901)
	at org.jruby.RubyString.newFrozen(RubyString.java:968)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1642)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1554)
	at org.jruby.RubyString.patternSearch(RubyString.java:3770)
	at org.jruby.RubyString.scanOnce(RubyString.java:3721)
	at org.jruby.RubyString.scan19(RubyString.java:3689)
	at java.lang.invoke.LambdaForm$DMH/2547507.invokeVirtual_L4_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$BMH/29847974.reinvoke(LambdaForm$BMH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$MH/27654272.linkToCallSite(LambdaForm$MH)
	at regexdna.RUBY$block$\=regexdna\,rb$1(regexdna.rb:28)
	at java.lang.invoke.LambdaForm$DMH/14655327.invokeStatic_L7_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$MH/17337681.invokeExact_MT(LambdaForm$MH)
	at org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:68)
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:69)
	at org.jruby.runtime.Block.call(Block.java:106)
	at org.jruby.RubyProc.call(RubyProc.java:319)
	at org.jruby.RubyProc.call(RubyProc.java:232)
	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
	at java.lang.Thread.run(Thread.java:745)
Exception in thread "Ruby-0-Thread-4: regexdna.rb:8" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Ruby-0-Thread-6: regexdna.rb:8" java.lang.OutOfMemoryError: Java heap space
	at org.jruby.util.ByteList.<init>(ByteList.java:91)
	at org.jruby.util.ByteList.dup(ByteList.java:325)
	at org.jruby.util.ByteList.dup(ByteList.java:297)
	at org.jruby.RubyString.modify(RubyString.java:901)
	at org.jruby.RubyString.resize(RubyString.java:976)
	at org.jruby.RubyString.freeze(RubyString.java:5360)
	at org.jruby.RubyRegexp.createMatchData(RubyRegexp.java:1541)
	at org.jruby.RubyRegexp.createMatchData19(RubyRegexp.java:1670)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1638)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1554)
	at org.jruby.RubyString.patternSearch(RubyString.java:3770)
	at org.jruby.RubyString.scanOnce(RubyString.java:3721)
	at org.jruby.RubyString.scan19(RubyString.java:3689)
	at java.lang.invoke.LambdaForm$DMH/2547507.invokeVirtual_L4_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$BMH/29847974.reinvoke(LambdaForm$BMH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$MH/27654272.linkToCallSite(LambdaForm$MH)
	at regexdna.RUBY$block$\=regexdna\,rb$1(regexdna.rb:28)
	at java.lang.invoke.LambdaForm$DMH/14655327.invokeStatic_L7_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$MH/17337681.invokeExact_MT(LambdaForm$MH)
	at org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:68)
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:69)
	at org.jruby.runtime.Block.call(Block.java:106)
	at org.jruby.RubyProc.call(RubyProc.java:319)
	at org.jruby.RubyProc.call(RubyProc.java:232)
	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
	at java.lang.Thread.run(Thread.java:745)
Exception in thread "Ruby-0-Thread-5: regexdna.rb:8" java.lang.OutOfMemoryError: Java heap space
	at org.jruby.util.ByteList.<init>(ByteList.java:91)
	at org.jruby.util.ByteList.dup(ByteList.java:325)
	at org.jruby.util.ByteList.dup(ByteList.java:297)
	at org.jruby.RubyString.modify(RubyString.java:901)
	at org.jruby.RubyString.resize(RubyString.java:976)
	at org.jruby.RubyString.freeze(RubyString.java:5360)
	at org.jruby.RubyRegexp.createMatchData(RubyRegexp.java:1541)
	at org.jruby.RubyRegexp.createMatchData19(RubyRegexp.java:1670)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1638)
	at org.jruby.RubyRegexp.search19(RubyRegexp.java:1554)
	at org.jruby.RubyString.patternSearch(RubyString.java:3770)
	at org.jruby.RubyString.scanOnce(RubyString.java:3721)
	at org.jruby.RubyString.scan19(RubyString.java:3689)
	at java.lang.invoke.LambdaForm$DMH/2547507.invokeVirtual_L4_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$BMH/29847974.reinvoke(LambdaForm$BMH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$reinvoker/9852548.dontInline(LambdaForm$reinvoker)
	at java.lang.invoke.LambdaForm$MH/26596002.guard(LambdaForm$MH)
	at java.lang.invoke.LambdaForm$MH/27654272.linkToCallSite(LambdaForm$MH)
	at regexdna.RUBY$block$\=regexdna\,rb$1(regexdna.rb:28)
	at java.lang.invoke.LambdaForm$DMH/14655327.invokeStatic_L7_L(LambdaForm$DMH)
	at java.lang.invoke.LambdaForm$MH/17337681.invokeExact_MT(LambdaForm$MH)
	at org.jruby.runtime.CompiledIRBlockBody.commonYieldPath(CompiledIRBlockBody.java:68)
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:69)
	at org.jruby.runtime.Block.call(Block.java:106)
	at org.jruby.RubyProc.call(RubyProc.java:319)
	at org.jruby.RubyProc.call(RubyProc.java:232)
	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
	at java.lang.Thread.run(Thread.java:745)
Exception in thread "Ruby-0-Thread-9: regexdna.rb:8" java.lang.OutOfMemoryError: Java heap space

Revised BSD license

  Home   Conclusions   License   Play