Skip to content

Commit 4f5c98a

Browse files
committed
fix
1 parent 8ef71f9 commit 4f5c98a

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

asynctnt/iproto/tupleobj/tupleobj.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ttuple_dealloc(AtntTupleObject *o)
9898
}
9999
Py_TYPE(o)->tp_free((PyObject *)o);
100100
done:
101-
CPy_TRASHCAN_END(o)
101+
CPy_TRASHCAN_END(o);
102102
}
103103

104104

bench/benchmark.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,36 @@ def main():
3434
]
3535

3636
for use_uvloop in [True]:
37+
run_func = asyncio.run
3738
if use_uvloop:
3839
try:
3940
import uvloop
4041
except ImportError:
4142
print("No uvloop installed. Skipping.") # noqa: T201
4243
continue
4344

44-
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
45-
else:
46-
asyncio.set_event_loop_policy(None)
47-
asyncio.set_event_loop(None)
48-
loop = asyncio.new_event_loop()
49-
asyncio.set_event_loop(loop)
45+
run_func = uvloop.run
5046

5147
print("--------- uvloop: {} --------- ".format(use_uvloop)) # noqa: T201
5248

5349
for name, conn_creator in [
5450
("asynctnt", create_asynctnt),
5551
# ('aiotarantool', create_aiotarantool),
5652
]:
57-
conn = loop.run_until_complete(conn_creator())
58-
for scenario in scenarios:
59-
loop.run_until_complete(
60-
async_bench(
53+
async def main():
54+
conn = await conn_creator()
55+
for scenario in scenarios:
56+
await async_bench(
6157
name,
6258
conn,
6359
args.n,
6460
args.b,
6561
method=scenario[0],
6662
args=scenario[1],
6763
kwargs=scenario[2] if len(scenario) > 2 else {},
68-
)
69-
)
64+
)
7065

66+
run_func(main())
7167

7268
async def async_bench(name, conn, n, b, method, args=None, kwargs=None):
7369
if kwargs is None:

0 commit comments

Comments
 (0)