import asyncio import time def test(loop, iterations=10**4): loop._ready.clear() t0 = time.perf_counter() for x in range(iterations): loop.call_soon(str) dt = time.perf_counter() - t0 loop._ready.clear() return dt / iterations @asyncio.coroutine def bench(loop, runs=5): yield from [] perf = [test(loop) for run in range(runs)] best = min(perf) print("call_soon(): %.0f ns per call" % (best * 1e9)) loop = asyncio.get_event_loop() loop.run_until_complete(bench(loop)) loop.close()