tests/bench: run roundtrip.py a ton more to reduce variance

issue510
David Wilson 6 years ago
parent d1b7c232bf
commit 3836c6a220

@ -5,13 +5,22 @@ Measure latency of local RPC.
import mitogen
import time
import ansible_mitogen.process
ansible_mitogen.process.setup_gil()
try:
xrange
except NameError:
xrange = range
def do_nothing():
pass
@mitogen.main()
def main(router):
f = router.fork()
f.call(do_nothing)
t0 = time.time()
for x in range(1000):
for x in xrange(20000):
f.call(do_nothing)
print '++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec'
print('++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec')

Loading…
Cancel
Save