We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a363fb8 commit 3341173Copy full SHA for 3341173
benchmark.py
@@ -1,4 +1,5 @@
1
import asyncio
2
+from functools import partial
3
from typing import Any, Callable
4
5
import pytest
@@ -305,9 +306,10 @@ async def dummy_coro():
305
306
307
iterations = range(1000)
308
create_future = loop.create_future
- callback = func._task_done_callback
309
+ callback_fn = func._task_done_callback
310
311
@benchmark
312
def run() -> None:
313
for i in iterations:
- callback(create_future(), i, task)
314
+ callback = partial(callback_fn, create_future(), i)
315
+ callback(task)
0 commit comments