Python Interpreters Benchmarks
x64 ArchLinux : AMD® Ryzen 7 4700U®

 performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load

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

Read  benchmark to see what this program should do.

 notes

  source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# submitted by Ian Osgood
# modified by Sokolov Yura
# modified by bearophile
# 2to3

from sys import stdin

def gen_freq(seq, frame, frequences):
    ns = len(seq) + 1 - frame
    frequences.clear()
    for ii in range(ns):
        nucleo = seq[ii:ii + frame]
        if nucleo in frequences:
            frequences[nucleo] += 1
        else:
            frequences[nucleo] = 1
    return ns, frequences


def sort_seq(seq, length, frequences):
    n, frequences = gen_freq(seq, length, frequences)

    l = sorted(list(frequences.items()), reverse=True, key=lambda seq_freq: (seq_freq[1],seq_freq[0]))

    print '\n'.join("%s %.3f" % (st, 100.0*fr/n) for st,fr in l)
    print


def find_seq(seq, s, frequences):
    n,t = gen_freq(seq, len(s), frequences)
    print "%d\t%s" % (t.get(s, 0), s)


def main():
    frequences = {}
    for line in stdin:
        if line[0:3] == ">TH":
            break

    seq = []
    for line in stdin:
        if line[0] in ">;":
            break
        seq.append( line[:-1] )
    sequence = "".join(seq).upper()

    for nl in 1,2:
        sort_seq(sequence, nl, frequences)

    for se in "GGT GGTA GGTATT GGTATTTTAATT GGTATTTTAATTTATAGT".split():
        find_seq(sequence, se, frequences)

main()

 make, command-line, and program output logs

 Fri, 30 Oct 2020 21:33:35 GMT

MAKE:
make[1]: Vstupuje se do adresáře „/home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp“
cp knucleotide.shedskin shed.py
shedskin shed.py
*** SHED SKIN Python-to-C++ Compiler 0.9.4 ***
Copyright 2005-2011 Mark Dufour; License GNU GPL version 3 (See LICENSE)

[analyzing types..]

0% 
********************************100% 
********************************100% 
********************************100%
[generating c++ code..]
[elapsed time: 1.76 seconds]
make
make[2]: Vstupuje se do adresáře „/home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp“
g++  -O2 -march=native -Wno-deprecated  -I. -I/usr/lib/python2.7/site-packages/shedskin/lib /home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp/shed.cpp /usr/lib/python2.7/site-packages/shedskin/lib/sys.cpp /usr/lib/python2.7/site-packages/shedskin/lib/re.cpp /usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp -lgc -lpcre  -o shed
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:1216,
                 from /home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp/shed.cpp:1:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In member function ‘__shedskin__::complex& __shedskin__::complex::operator=(double)’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
   71 |     imag = 0.0;
  +++ |+    return *this;
   72 | }
      | ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_int __shedskin__::__cmp(T, T) [with T = __shedskin__::complex; __shedskin__::__ss_int = int]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:107:57: warning: no return statement in function returning non-void [-Wreturn-type]
  107 | template<> inline __ss_int __cmp(complex a, complex b) {} /* unused, satisfy templates */
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__gt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:108:57: warning: no return statement in function returning non-void [-Wreturn-type]
  108 | template<> inline __ss_bool __gt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__ge(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:109:57: warning: no return statement in function returning non-void [-Wreturn-type]
  109 | template<> inline __ss_bool __ge(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__lt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:110:57: warning: no return statement in function returning non-void [-Wreturn-type]
  110 | template<> inline __ss_bool __lt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__le(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:111:57: warning: no return statement in function returning non-void [-Wreturn-type]
  111 | template<> inline __ss_bool __le(complex a, complex b) {}
      |                                                         ^
/home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp/shed.cpp: In member function ‘virtual __shedskin__::str* __shed__::list_comp_0::__get_next()’:
/home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp/shed.cpp:52:22: warning: control reaches end of non-void function [-Wreturn-type]
   52 |     __stop_iteration = true;
      |     ~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:1216,
                 from /usr/lib/python2.7/site-packages/shedskin/lib/sys.hpp:6,
                 from /usr/lib/python2.7/site-packages/shedskin/lib/sys.cpp:3:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In member function ‘__shedskin__::complex& __shedskin__::complex::operator=(double)’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
   71 |     imag = 0.0;
  +++ |+    return *this;
   72 | }
      | ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_int __shedskin__::__cmp(T, T) [with T = __shedskin__::complex; __shedskin__::__ss_int = int]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:107:57: warning: no return statement in function returning non-void [-Wreturn-type]
  107 | template<> inline __ss_int __cmp(complex a, complex b) {} /* unused, satisfy templates */
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__gt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:108:57: warning: no return statement in function returning non-void [-Wreturn-type]
  108 | template<> inline __ss_bool __gt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__ge(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:109:57: warning: no return statement in function returning non-void [-Wreturn-type]
  109 | template<> inline __ss_bool __ge(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__lt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:110:57: warning: no return statement in function returning non-void [-Wreturn-type]
  110 | template<> inline __ss_bool __lt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__le(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:111:57: warning: no return statement in function returning non-void [-Wreturn-type]
  111 | template<> inline __ss_bool __le(complex a, complex b) {}
      |                                                         ^
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:1216,
                 from /usr/lib/python2.7/site-packages/shedskin/lib/re.hpp:9,
                 from /usr/lib/python2.7/site-packages/shedskin/lib/re.cpp:3:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In member function ‘__shedskin__::complex& __shedskin__::complex::operator=(double)’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
   71 |     imag = 0.0;
  +++ |+    return *this;
   72 | }
      | ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_int __shedskin__::__cmp(T, T) [with T = __shedskin__::complex; __shedskin__::__ss_int = int]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:107:57: warning: no return statement in function returning non-void [-Wreturn-type]
  107 | template<> inline __ss_int __cmp(complex a, complex b) {} /* unused, satisfy templates */
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__gt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:108:57: warning: no return statement in function returning non-void [-Wreturn-type]
  108 | template<> inline __ss_bool __gt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__ge(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:109:57: warning: no return statement in function returning non-void [-Wreturn-type]
  109 | template<> inline __ss_bool __ge(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__lt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:110:57: warning: no return statement in function returning non-void [-Wreturn-type]
  110 | template<> inline __ss_bool __lt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__le(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:111:57: warning: no return statement in function returning non-void [-Wreturn-type]
  111 | template<> inline __ss_bool __le(complex a, complex b) {}
      |                                                         ^
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:1216,
                 from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp:3:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In member function ‘__shedskin__::complex& __shedskin__::complex::operator=(double)’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
   71 |     imag = 0.0;
  +++ |+    return *this;
   72 | }
      | ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_int __shedskin__::__cmp(T, T) [with T = __shedskin__::complex; __shedskin__::__ss_int = int]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:107:57: warning: no return statement in function returning non-void [-Wreturn-type]
  107 | template<> inline __ss_int __cmp(complex a, complex b) {} /* unused, satisfy templates */
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__gt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:108:57: warning: no return statement in function returning non-void [-Wreturn-type]
  108 | template<> inline __ss_bool __gt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__ge(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:109:57: warning: no return statement in function returning non-void [-Wreturn-type]
  109 | template<> inline __ss_bool __ge(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__lt(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:110:57: warning: no return statement in function returning non-void [-Wreturn-type]
  110 | template<> inline __ss_bool __lt(complex a, complex b) {}
      |                                                         ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp: In function ‘__shedskin__::__ss_bool __shedskin__::__le(T, T) [with T = __shedskin__::complex]’:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/complex.hpp:111:57: warning: no return statement in function returning non-void [-Wreturn-type]
  111 | template<> inline __ss_bool __le(complex a, complex b) {}
      |                                                         ^
/usr/bin/ld: /tmp/ccw0aMpJ.o: in function `__shed__::__lambda0__(__shedskin__::tuple2<__shedskin__::str*, int>*)':
shed.cpp:(.text+0x185): undefined reference to `GC_throw_bad_alloc()'
/usr/bin/ld: /tmp/ccw0aMpJ.o: in function `__shed__::gen_freq(__shedskin__::str*, int, __shedskin__::dict<__shedskin__::str*, int>*)':
shed.cpp:(.text+0x390): undefined reference to `GC_throw_bad_alloc()'
/usr/bin/ld: /tmp/ccw0aMpJ.o: in function `__shed__::sort_seq(__shedskin__::str*, int, __shedskin__::dict<__shedskin__::str*, int>*)':
shed.cpp:(.text+0x7eb): undefined reference to `GC_throw_bad_alloc()'
/usr/bin/ld: shed.cpp:(.text+0x7f9): undefined reference to `GC_throw_bad_alloc()'
/usr/bin/ld: shed.cpp:(.text+0x807): undefined reference to `GC_throw_bad_alloc()'
/usr/bin/ld: /tmp/ccw0aMpJ.o:shed.cpp:(.text+0xb78): more undefined references to `GC_throw_bad_alloc()' follow
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:19: shed] Chyba 1
make[2]: Opouští se adresář „/home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp“
make[1]: *** [/home/dundee/work/pybenchmarks/bencher/makefiles/my.linux.Makefile:30: knucleotide.shedskin_run] Chyba 2
make[1]: Opouští se adresář „/home/dundee/work/pybenchmarks/bencher/tmp/knucleotide/tmp“
10.40s to complete and log all make actions

COMMAND LINE:
 ./shed 0 < knucleotide-input10000.txt

MAKE ERROR 

Revised BSD license

  Home   Conclusions   License   Play