8000 minor fixes for asyncio_websockets benchmark (#311) · python/pyperformance@ef1d636 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef1d636

Browse files
minor fixes for asyncio_websockets benchmark (#311)
1 parent e1e8385 commit ef1d636

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pyperformance/data-files/benchmarks/bm_asyncio_websockets/run_benchmark.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
"""
22
Benchmark for asyncio websocket server and client performance
3-
transferring 10MB of data.
3+
transferring 1MB of data.
4+
5+
Author: Kumar Aditya
46
"""
57

68
import pyperf
79
import websockets.server
810
import websockets.client
911
import asyncio
1012

11-
CHUNK_SIZE = 1024
13+
CHUNK_SIZE = 1024 ** 2
1214
DATA = b"x" * CHUNK_SIZE
1315

1416
stop: asyncio.Event
1517

1618

1719
async def handler(websocket) -> None:
1820
for _ in range(100):
19-
data = await websocket.recv()
20-
assert data == DATA
21+
await websocket.recv()
2122

2223
stop.set()
2324

0 commit comments

Comments
 (0)
0