Skip to content

Commit 121d809

Browse files
Add network backend benchmark param
1 parent b47b4c2 commit 121d809

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/benchmark/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
CONCURRENCY = 20
2222
POOL_LIMIT = 100
2323
PROFILE = False
24-
os.environ["HTTPCORE_PREFER_ANYIO"] = "0"
24+
NET_BACKEND = httpcore.AsyncioBackend
2525

2626

2727
def duration(start: float) -> int:
@@ -66,7 +66,7 @@ async def aiohttp_get(session: aiohttp.ClientSession, timings: List[int]) -> Non
6666
assert res.status == 200, f"status={res.status}"
6767
timings.append(duration(start))
6868

69-
async with httpcore.AsyncConnectionPool(max_connections=POOL_LIMIT) as pool:
69+
async with httpcore.AsyncConnectionPool(max_connections=POOL_LIMIT, network_backend=NET_BACKEND()) as pool:
7070
# warmup
7171
await gather_limited_concurrency(
7272
(httpcore_get(pool, []) for _ in range(REQUESTS)), CONCURRENCY * 2

0 commit comments

Comments
 (0)