Commit c1300da3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6ade4c8c
...@@ -906,7 +906,7 @@ bench_cpu() { ...@@ -906,7 +906,7 @@ bench_cpu() {
echo -ne "node:\t"; xhostname echo -ne "node:\t"; xhostname
echo "cluster:" echo "cluster:"
nrun sh -c "python -m test.pystone |tail -1 |sed -e \ nrun sh -c "python -m test.pystone |tail -1 |sed -e \
\"s|^This machine benchmarks at \([0-9.]\+\) pystones/second$|Benchmark`xhostname`/pystone 1 \1 pystone/s|\"" \"s|^This machine benchmarks at \([0-9.]\+\) pystones/second$|Benchmarkpystone 1 \1 pystone/s|\""
sizev="1024 4096 $((2*1024*1024))" sizev="1024 4096 $((2*1024*1024))"
benchv="adler32 crc32 sha1" benchv="adler32 crc32 sha1"
......
...@@ -75,12 +75,7 @@ func benchit(benchname string, bencharg string, benchf func(*testing.B, string)) ...@@ -75,12 +75,7 @@ func benchit(benchname string, bencharg string, benchf func(*testing.B, string))
benchf(b, bencharg) benchf(b, bencharg)
}) })
hostname, err := os.Hostname() fmt.Printf("Benchmark%s/go/%s %d\t%.3f µs/op\n", benchname, prettyarg(bencharg), r.N, float64(r.T) / float64(r.N) / float64(time.Microsecond))
if err != nil {
hostname = "?"
}
fmt.Printf("Benchmark%s/%s/go/%s %d\t%.3f µs/op\n", hostname, benchname, prettyarg(bencharg), r.N, float64(r.T) / float64(r.N) / float64(time.Microsecond))
} }
......
...@@ -28,7 +28,6 @@ import tzodb ...@@ -28,7 +28,6 @@ import tzodb
import zlib import zlib
from time import time from time import time
from math import ceil, log10 from math import ceil, log10
import socket
# fmtsize formats size in human readable form # fmtsize formats size in human readable form
_unitv = "BKMGT" # (2^10)^i represents by corresponding char suffix _unitv = "BKMGT" # (2^10)^i represents by corresponding char suffix
...@@ -102,13 +101,12 @@ def benchit(benchf, bencharg, ttarget = 1.): ...@@ -102,13 +101,12 @@ def benchit(benchf, bencharg, ttarget = 1.):
b.stop_timer() b.stop_timer()
t = b.total_time() t = b.total_time()
hostname = socket.gethostname()
benchname = benchf.__name__ benchname = benchf.__name__
if benchname.startswith('bench_'): if benchname.startswith('bench_'):
benchname = benchname[len('bench_'):] benchname = benchname[len('bench_'):]
print('Benchmark%s/%s/py/%s %d\t%.3f µs/op' % print('Benchmark%s/py/%s %d\t%.3f µs/op' %
(hostname, benchname, prettyarg(bencharg), n, t * 1E6 / n)) (benchname, prettyarg(bencharg), n, t * 1E6 / n))
# ---- 8< ---- # ---- 8< ----
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment