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 e1e8385 commit ef1d636Copy full SHA for ef1d636
pyperformance/data-files/benchmarks/bm_asyncio_websockets/run_benchmark.py
@@ -1,23 +1,24 @@
1
"""
2
Benchmark for asyncio websocket server and client performance
3
-transferring 10MB of data.
+transferring 1MB of data.
4
+
5
+Author: Kumar Aditya
6
7
8
import pyperf
9
import websockets.server
10
import websockets.client
11
import asyncio
12
-CHUNK_SIZE = 1024
13
+CHUNK_SIZE = 1024 ** 2
14
DATA = b"x" * CHUNK_SIZE
15
16
stop: asyncio.Event
17
18
19
async def handler(websocket) -> None:
20
for _ in range(100):
- data = await websocket.recv()
- assert data == DATA
21
+ await websocket.recv()
22
23
stop.set()
24
0 commit comments