tests: import various bench/ scripts.
parent
8a2e8964a9
commit
e1402b2214
@ -0,0 +1,15 @@
|
||||
"""
|
||||
Measure latency of .fork() setup/teardown.
|
||||
"""
|
||||
|
||||
import mitogen
|
||||
import time
|
||||
|
||||
@mitogen.main()
|
||||
def main(router):
|
||||
t0 = time.time()
|
||||
for x in xrange(200):
|
||||
t = time.time()
|
||||
ctx = router.fork()
|
||||
ctx.shutdown(wait=True)
|
||||
print '++', 1000 * ((time.time() - t0) / (1.0+x))
|
@ -0,0 +1,17 @@
|
||||
"""
|
||||
Measure latency of local RPC.
|
||||
"""
|
||||
|
||||
import mitogen
|
||||
import time
|
||||
|
||||
def do_nothing():
|
||||
pass
|
||||
|
||||
@mitogen.main()
|
||||
def main(router):
|
||||
f = router.fork()
|
||||
t0 = time.time()
|
||||
for x in xrange(1000):
|
||||
f.call(do_nothing)
|
||||
print '++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec'
|
Loading…
Reference in New Issue