Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ typing-extensions==4.13.2
# via multidict
uvloop==0.21.0 ; platform_system != "Windows" and implementation_name == "cpython"
# via -r requirements/base.in
yarl==1.19.0
yarl==1.20.0
# via -r requirements/runtime-deps.in
10 changes: 9 additions & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ incremental==24.7.2
# via towncrier
iniconfig==2.1.0
# via pytest
isal==1.7.2
# via
# -r requirements/lint.in
# -r requirements/test.in
jinja2==3.1.6
# via
# sphinx
Expand Down Expand Up @@ -282,8 +286,12 @@ wait-for-it==2.3.0
# via -r requirements/test.in
wheel==0.46.0
# via pip-tools
yarl==1.19.0
yarl==1.20.0
# via -r requirements/runtime-deps.in
zlib-ng==0.5.1
# via
# -r requirements/lint.in
# -r requirements/test.in

# The following packages are considered to be unsafe in a requirements file:
pip==25.0.1
Expand Down
12 changes: 8 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ incremental==24.7.2
iniconfig==2.1.0
# via pytest
isal==1.7.2
# via -r requirements/test.in
# via
# -r requirements/lint.in
# -r requirements/test.in
jinja2==3.1.6
# via
# sphinx
Expand Down Expand Up @@ -275,10 +277,12 @@ wait-for-it==2.3.0
# via -r requirements/test.in
wheel==0.46.0
# via pip-tools
yarl==1.19.0
yarl==1.20.0
# via -r requirements/runtime-deps.in
zlib_ng==0.5.1
# via -r requirements/test.in
zlib-ng==0.5.1
# via
# -r requirements/lint.in
# -r requirements/test.in

# The following packages are considered to be unsafe in a requirements file:
pip==25.0.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/runtime-deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ pycparser==2.22
# via cffi
typing-extensions==4.13.2
# via multidict
yarl==1.19.0
yarl==1.20.0
# via -r requirements/runtime-deps.in
4 changes: 2 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ uvloop==0.21.0 ; platform_system != "Windows" and implementation_name == "cpytho
# via -r requirements/base.in
wait-for-it==2.3.0
# via -r requirements/test.in
yarl==1.19.0
yarl==1.20.0
# via -r requirements/runtime-deps.in
zlib_ng==0.5.1
zlib-ng==0.5.1
# via -r requirements/test.in
6 changes: 5 additions & 1 deletion tests/test_benchmarks_client_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio

import pytest
from pytest_codspeed import BenchmarkFixture

from aiohttp import web
Expand Down Expand Up @@ -40,19 +41,22 @@ def _run() -> None:
loop.run_until_complete(run_websocket_benchmark())


@pytest.mark.parametrize("msg_size", [6, MSG_SIZE * 4], ids=["small", "large"])
def test_one_thousand_round_trip_websocket_binary_messages(
loop: asyncio.AbstractEventLoop,
aiohttp_client: AiohttpClient,
benchmark: BenchmarkFixture,
msg_size: int,
) -> None:
"""Benchmark round trip of 1000 WebSocket binary messages."""
message_count = 1000
raw_message = b"x" * msg_size

async def handler(request: web.Request) -> web.WebSocketResponse:
ws = web.WebSocketResponse()
await ws.prepare(request)
for _ in range(message_count):
await ws.send_bytes(b"answer")
await ws.send_bytes(raw_message)
await ws.close()
return ws

Expand Down
Loading