performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
10,0000.050.05?524  100% 0% 0% 0%
10,0000.050.05?524  0% 0% 100% 0%
10,0000.050.05?524  29% 29% 0% 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

 regex-dna Cython #5 program source code

# The Computer Language Benchmarks Game
# http://shootout.alioth.debian.org/
# contributed by Dominique Wahli
# 2to3
# modified by Justin Peel

from sys import stdin,stdout
from re import sub, findall

def main():
    seq = stdin.buffer.read()
    write = stdout.buffer.write
    ilen = len(seq)

    seq = sub(b'>.*\n|\n', b'', seq)
    clen = len(seq)

    variants = (
          b'agggtaaa|tttaccct',
          b'[cgt]gggtaaa|tttaccc[acg]',
          b'a[act]ggtaaa|tttacc[agt]t',
          b'ag[act]gtaaa|tttac[agt]ct',
          b'agg[act]taaa|ttta[agt]cct',
          b'aggg[acg]aaa|ttt[cgt]ccct',
          b'agggt[cgt]aa|tt[acg]accct',
          b'agggta[cgt]a|t[acg]taccct',
          b'agggtaa[cgt]|[acg]ttaccct')
    for f in variants:
        write(f + b' ' +bytes(str(len(findall(f, seq))),encoding='latin1') + b'\n')

    subst = {
          b'B' : b'(c|g|t)', b'D' : b'(a|g|t)',   b'H' : b'(a|c|t)', b'K' : b'(g|t)',
          b'M' : b'(a|c)',   b'N' : b'(a|c|g|t)', b'R' : b'(a|g)',   b'S' : b'(c|g)',
          b'V' : b'(a|c|g)', b'W' : b'(a|t)',     b'Y' : b'(c|t)'}
    for f, r in subst.items():
        seq = sub(f, r, seq)
    write(b'\n')
    write(bytes(str(ilen),encoding='latin1') + b'\n')
    write(bytes(str(clen),encoding='latin1') + b'\n')
    write(bytes(str(len(seq)),encoding='latin1') + b'\n')

main()

 make, command-line, and program output logs

Mon, 15 Oct 2018 12:16:29 GMT

MAKE:
make[1]: Vstupuje se do adresáře „/home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp“
cp regexdna.cython-5.cython `echo regexdna.cython-5.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx
cythonize -3 -bi `echo regexdna.cython-5.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx
Compiling /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/regexdna.pyx because it changed.
[1/1] Cythonizing /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/regexdna.pyx
running build_ext
building 'regexdna' extension
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame/bencher
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame/bencher/tmp
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -flto=4 -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -I/usr/include/python3.7m -c /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/regexdna.c -o /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/regexdna.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=4 -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/tmpf8c8grf1/home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/regexdna.o -L/usr/lib -lpython3.7m -o /home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp/regexdna.cpython-37m-x86_64-linux-gnu.so
make[1]: Opouští se adresář „/home/dundee/workspace/benchmarksgame/bencher/tmp/regexdna/tmp“
2.39s to complete and log all make actions

COMMAND LINE:
/usr/bin/python3 -c "import regexdna" 0 < regexdna-input10000.txt

PROGRAM OUTPUT:
agggtaaa|tttaccct 0
[cgt]gggtaaa|tttaccc[acg] 3
a[act]ggtaaa|tttacc[agt]t 9
ag[act]gtaaa|tttac[agt]ct 8
agg[act]taaa|ttta[agt]cct 10
aggg[acg]aaa|ttt[cgt]ccct 3
agggt[cgt]aa|tt[acg]accct 4
agggta[cgt]a|t[acg]taccct 3
agggtaa[cgt]|[acg]ttaccct 5

101745
100000
133640

Revised BSD license

  Home   Conclusions   License   Play