tests: Standardise output of connection benchmarks

pull/1425/head
Alex Willmer 1 day ago
parent 0d7a549182
commit 088a640b6e

@ -25,6 +25,7 @@ In progress (unreleased)
``if sys.version_info`` blocks
* :gh:issue:`1423` tests: Group and unify naming of connection benchmarks
* :gh:issue:`1424` tests: Parameterize connection benchmarks
* :gh:issue:`1424` tests: Standardise output of connection benchmarks
v0.3.37 (2026-01-08)

@ -26,4 +26,7 @@ def main(router):
t = mitogen.core.now()
ctx = router.fork(debug=opts.debug)
ctx.shutdown(wait=True)
print('++ %d' % 1000 * ((mitogen.core.now() - t0) / (1.0+x)))
t1 = mitogen.core.now()
mean = (t1 - t0) / opts.iterations
print('++ iterations %d, mean %.03f ms' % (opts.iterations, 1e3 * mean))

@ -32,4 +32,7 @@ def main(router):
t0 = mitogen.core.now()
for x in xrange(opts.iterations):
f.call(do_nothing)
print('++', int(1e6 * ((mitogen.core.now() - t0) / (1.0+x))), 'usec')
t1 = mitogen.core.now()
mean = (t1 - t0) / opts.iterations
print('++ iterations %d, mean %.03f us' % (opts.iterations, 1e6 * mean))

@ -27,5 +27,7 @@ def main(router):
t = mitogen.core.now()
f = router.local(debug=opts.debug)
tt = mitogen.core.now()
print(x, 1000 * (tt - t))
print('%.03f ms' % (1000 * (mitogen.core.now() - t0) / (1.0 + x)))
t1 = mitogen.core.now()
mean = (t1 - t0) / opts.iterations
print('++ iterations %d, mean %.03f ms' % (opts.iterations, 1e3 * mean))

@ -43,6 +43,8 @@ def main(router):
while mitogen.core.now() < end:
f.call(do_nothing)
i += 1
t1 = mitogen.core.now()
print('++', float(1e3 * (t1 - t0) / (1.0+i)), 'ms')
t1 = mitogen.core.now()
iterations = i + 1
mean = (t1 - t0) / iterations
print('++ iterations %d, mean %.03f ms' % (iterations, 1e3 * mean))

Loading…
Cancel
Save