aio-libs
aiohttp
BlogDocsChangelog

Optimize small HTTP requests/responses by coalescing headers and body into a single packet

#10991Merged
Comparing
reduce_syscalls_write
(
f97c4c7
) with
master
(
54f1a84
)
CodSpeed Performance Gauge
+9%
Improvements
1
Untouched
58
Ignored
7

Benchmarks

Improved

test_get_request_with_251308_compressed_chunked_payload[isal.isal_zlib-pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+9%
69.7 ms64.2 ms

Passed

test_one_hundred_get_requests_with_512kib_content_length_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+6%
175.8 ms165.4 ms
test_get_request_with_251308_compressed_chunked_payload[zlib_ng.zlib_ng-pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+2%
234.5 ms229.5 ms
test_one_hundred_json_post_requests[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+2%
38.8 ms38.2 ms
test_one_hundred_simple_post_requests[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+1%
37 ms36.5 ms
test_one_hundred_get_requests_with_1024_chunked_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+1%
35.6 ms35.2 ms
test_resolve_dynamic_resource_url_with_many_dynamic_routes_with_common_prefix[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
+1%
248.2 ms245.5 ms
test_one_hundred_get_requests_with_1024_content_length_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+1%
35.2 ms34.9 ms
test_one_hundred_get_requests_with_30000_chunked_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
+1%
40.7 ms40.3 ms
test_resolve_gitapi[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
+1%
294.8 ms293 ms
test_resolve_root_route[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
+1%
885.3 µs880.6 µs
test_simple_web_file_sendfile_fallback_response[pyloop]
tests/test_benchmarks_web_fileresponse.py
CodSpeed Performance Gauge
+1%
84.6 ms84.2 ms
test_simple_web_response
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
451.6 µs449.5 µs
test_resolve_gitapi_subapps[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
296.7 ms295.9 ms
test_resolve_dynamic_resource_url_with_many_dynamic_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
3.6 ms3.6 ms
test_resolve_root_route_with_many_fixed_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
885.1 µs883.6 µs
test_one_hundred_simple_get_requests_no_session[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
78.2 ms78.1 ms
test_resolve_gitapi_root[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
2 ms2 ms
test_load_cookies_into_temp_cookiejar
tests/test_benchmarks_cookiejar.py
CodSpeed Performance Gauge
0%
197 µs196.7 µs
test_web_response_with_bytes_body
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
549.7 µs548.9 µs
test_get_request_with_251308_compressed_chunked_payload[zlib-pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
426.5 ms426 ms
test_web_response_with_headers
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
685.3 µs684.5 µs
test_one_thousand_round_trip_websocket_text_messages[pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
16.8 ms16.8 ms
test_resolve_static_root_route[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
982.6 µs981.7 µs
test_send_one_hundred_websocket_compressed_messages[zlib-pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
3.1 ms3.1 ms
test_web_response_with_text_body
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
666.2 µs665.8 µs
test_read_one_hundred_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
211.7 µs211.7 µs
test_simple_web_stream_response
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
246.6 µs246.5 µs
test_read_large_binary_websocket_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
8.9 ms8.9 ms
test_resolve_single_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
890.3 µs890.2 µs
test_client_receive_large_websocket_compressed_messages[zlib-pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
50.2 ms50.2 ms
test_one_thousand_round_trip_websocket_binary_messages[pyloop-small]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
16.3 ms16.3 ms
test_one_thousand_large_round_trip_websocket_text_messages[pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
21.5 ms21.5 ms
test_client_send_large_websocket_compressed_messages[zlib-pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
50.2 ms50.3 ms
test_create_client_request_with_headers[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
0%
70 µs70 µs
test_resolve_dynamic_resource_url_with_many_static_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
3.6 ms3.6 ms
test_one_thousand_round_trip_websocket_binary_messages[pyloop-large]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
110 ms110.1 ms
test_ten_streamed_responses_iter_chunked_4096[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
27.8 ms27.8 ms
test_create_client_request_with_cookies[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
0%
126.5 µs126.6 µs
test_simple_web_file_response_not_modified[pyloop]
tests/test_benchmarks_web_fileresponse.py
CodSpeed Performance Gauge
0%
55.2 ms55.2 ms
test_serialize_headers
tests/test_benchmarks_http_writer.py
CodSpeed Performance Gauge
0%
854.6 µs855.9 µs
test_send_one_hundred_websocket_compressed_messages[isal.isal_zlib-pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
4.7 ms4.7 ms
test_send_one_hundred_large_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
544.4 µs545.8 µs
test_one_hundred_simple_get_requests_multiple_methods_route[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
32.3 ms32.4 ms
test_one_hundred_simple_get_requests[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
32.5 ms32.7 ms
test_one_hundred_simple_get_requests_alternating_clients[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
33.2 ms33.4 ms
test_simple_web_file_response[pyloop]
tests/test_benchmarks_web_fileresponse.py
CodSpeed Performance Gauge
0%
78.2 ms78.5 ms
test_resolve_multiple_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
2.2 ms2.2 ms
test_ten_web_middlewares[pyloop]
tests/test_benchmarks_web_middleware.py
CodSpeed Performance Gauge
0%
35.3 ms35.4 ms
test_resolve_multiple_level_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
8.5 ms8.6 ms
test_ten_streamed_responses_iter_chunks[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
15.9 ms16 ms
test_resolve_prefix_resources_many_prefix_many_plain[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
-1%
4.6 ms4.7 ms
test_send_one_hundred_websocket_text_messages_with_mask[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
-1%
797.1 µs801.2 µs
test_send_one_hundred_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
-1%
560.7 µs563.8 µs
test_client_request_update_cookies[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
-1%
165.4 µs166.4 µs
test_ten_streamed_responses_iter_chunked_65536[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
-1%
22.7 ms22.9 ms
test_send_one_hundred_websocket_compressed_messages[zlib_ng.zlib_ng-pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
-1%
2.1 ms2.1 ms
test_one_hundred_get_requests_with_30000_content_length_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
-2%
39.4 ms40.1 ms
test_send_client_request_one_hundred[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
-3%
2.5 ms2.6 ms

Ignored

test_client_send_large_websocket_compressed_messages[zlib_ng.zlib_ng-pyloop]
tests/test_benchmarks_client_ws.py
Ignored
CodSpeed Performance Gauge
-10%
27.3 ms30.4 ms
test_client_send_large_websocket_compressed_messages[isal.isal_zlib-pyloop]
tests/test_benchmarks_client_ws.py
Ignored
CodSpeed Performance Gauge
-6%
18.6 ms19.8 ms
test_client_receive_large_websocket_compressed_messages[isal.isal_zlib-pyloop]
tests/test_benchmarks_client_ws.py
Ignored
CodSpeed Performance Gauge
0%
19.7 ms19.8 ms
test_client_receive_large_websocket_compressed_messages[zlib_ng.zlib_ng-pyloop]
tests/test_benchmarks_client_ws.py
Ignored
CodSpeed Performance Gauge
-4%
29.7 ms30.9 ms
test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload[pyloop]
tests/test_benchmarks_client.py
Ignored
CodSpeed Performance Gauge
0%
119.6 ms119.4 ms
test_one_hundred_get_requests_with_512kib_chunked_payload[pyloop]
tests/test_benchmarks_client.py
Ignored
CodSpeed Performance Gauge
+14%
188.7 ms166 ms
test_ten_streamed_responses_iter_any[pyloop]
tests/test_benchmarks_client.py
Ignored
CodSpeed Performance Gauge
0%
21.5 ms21.5 ms

Commits

Click on a commit to change the comparison range
Base
master
54f1a84
+0.27%
tweak
8512b50
5 months ago
by bdraco
+0.02%
lint
e886a62
5 months ago
by bdraco
+8.33%
lint
e5ef341
5 months ago
by bdraco
+0.14%
edge cases
99e167f
5 months ago
by bdraco
-0.14%
guard
f97c4c7
5 months ago
by bdraco
© 2025 CodSpeed Technology
Home Terms Privacy Docs