import asyncio import perf async def coro_func(): pass def regular_func(): pass loop = asyncio.get_event_loop() future = asyncio.Future(loop=loop) task = loop.create_task(coro_func()) runner = perf.Runner() runner.bench_func('future', asyncio.isfuture, future) runner.bench_func('task', asyncio.isfuture, task) runner.bench_func('regular_func', asyncio.isfuture, regular_func) runner.bench_func('str', asyncio.isfuture, "abc")