/mobile Handheld Friendly website

 performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
50,000Bad Output  365   

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

V8 version 3.25.20 [console: dumb]

 regex-dna JavaScript V8 program source code

// The Computer Language Benchmarks Game
// http://benchmarksgame.alioth.debian.org/
//
// contributed by Jesse Millikan
// Base on the Ruby version by jose fco. gonzalez

var l, input = "", ilen, clen, 
 seqs = [
  /agggtaaa|tttaccct/ig,
  /[cgt]gggtaaa|tttaccc[acg]/ig,
  /a[act]ggtaaa|tttacc[agt]t/ig,
  /ag[act]gtaaa|tttac[agt]ct/ig,
  /agg[act]taaa|ttta[agt]cct/ig,
  /aggg[acg]aaa|ttt[cgt]ccct/ig,
  /agggt[cgt]aa|tt[acg]accct/ig,
  /agggta[cgt]a|t[acg]taccct/ig,
  /agggtaa[cgt]|[acg]ttaccct/ig],
 subs = { 
  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)' }
 
// readline strips the newline...
while(l = readline()) input += l + "\n"
ilen = input.length

// There is no in-place substitution
input = input.replace(/>.*\n|\n/g,"")
clen = input.length

for(i in seqs)
 print(seqs[i].source, (input.match(seqs[i]) || []).length)
 // match returns null if no matches, so replace with empty

for(k in subs)
 input = input.replace(k, subs[k], "g")
 // search string, replacement string, flags

print()
print(ilen)
print(clen)
print(input.length)

 make, command-line, and program output logs

Thu, 20 Mar 2014 07:26:47 GMT

COMMAND LINE:
/usr/local/src/v8/out/native/d8 --nodebugger regexdna.v8 -- 0 < regexdna-input50000.txt

UNEXPECTED OUTPUT 

13c13
< 500056
---
> 668262

PROGRAM OUTPUT:
agggtaaa|tttaccct 3
[cgt]gggtaaa|tttaccc[acg] 12
a[act]ggtaaa|tttacc[agt]t 43
ag[act]gtaaa|tttac[agt]ct 27
agg[act]taaa|ttta[agt]cct 58
aggg[acg]aaa|ttt[cgt]ccct 16
agggt[cgt]aa|tt[acg]accct 15
agggta[cgt]a|t[acg]taccct 18
agggtaa[cgt]|[acg]ttaccct 20

508411
500000
500056

Revised BSD license

  Home   Conclusions   License   Play