performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
5,000,0002.262.128,248407  30% 30% 26% 31%
5,000,0002.232.108,456407  34% 22% 31% 28%
5,000,0002.232.107,752407  26% 32% 27% 36%

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

Read thread-ring benchmark to see what this program should do.

 notes

 thread-ring Grumpy program source code

# The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# contributed by Daniel Nanz 2008-03-11

# Coroutines via enhanced generators
# 2to3

import sys
import itertools
      
def main(n = int(sys.argv[1]), n_threads=503, cycle=itertools.cycle):

    def worker(worker_id):
        
        n = 1
        while True:
            if n > 0:
                n = (yield (n - 1))
            else:
                print(worker_id)
                raise StopIteration


    threadRing = [worker(w) for w in range(1, n_threads + 1)]
    for t in threadRing: foo = next(t)           # start exec. gen. funcs
    sendFuncRing = [t.send for t in threadRing]   # speed...
    for send in cycle(sendFuncRing):
        try:
            n = send(n)
        except StopIteration:
            break

main()

 make, command-line, and program output logs

Mon, 13 Nov 2017 12:47:14 GMT

MAKE:
make[1]: Vstupuje se do adresáře „/home/dundee/workspace/benchmarksgame/bencher/tmp/threadring/tmp“
grumpc threadring.grumpy > threadring.grumpy.go
go build -o threadring.grumpy_run threadring.grumpy.go
warning: GOPATH set to GOROOT (/usr/lib/go) has no effect
make[1]: Opouští se adresář „/home/dundee/workspace/benchmarksgame/bencher/tmp/threadring/tmp“
1.96s to complete and log all make actions

COMMAND LINE:
./threadring.grumpy_run 5000000

PROGRAM OUTPUT:
181

Revised BSD license

  Home   Conclusions   License   Play