HTTP clients for Python: architecture, performance, and the state of HTTP/3

Introduction

HTTP requests are among the most common tasks in Python programs. Still, in 2026 there is no obvious choice of library for them. requests, the de facto standard for over a decade, is frozen in functionality. httpx, long touted as its successor, has not released a stable version since December 2024. Alongside them, clients have emerged that speak HTTP/3, embed libcurl, or have a core in Rust.

This article compares these clients, including curlyshed (external link, opens in a new tab), which the author developed for many small requests to a public data server. The benchmark setup, scripts, and raw data are open so that readers can inspect and reproduce the comparison.

This article investigates three questions:

RQ1 — Architecture: Which HTTP clients for Python are available, and in which layer does the actual protocol work happen?

RQ2 — Performance: How do the clients differ under controlled conditions in throughput, CPU time per request, and concurrency — asyncio and threads, each with and without the GIL — and what are the differences attributable to?

RQ3 — HTTP/3: Which clients expose HTTP/3, how does it perform in this setup, and which published QUIC security findings apply to their stacks?

Architectures

The clients fall into four groups based on where they do most of their protocol work.

Group Clients Protocol work in
Python on sockets http.client, urllib, requests (urllib3), urllib3 directly, httpx (h11, h2) Python
Python with native components aiohttp, niquests (urllib3-future, jh2, qh3) Python, individual parts in C or Rust
libcurl pycurl, curl_cffi, curlyshed C (libcurl, nghttp2, ngtcp2)
Rust core pyreqwest, rnet, ry Rust

Standard library

http.client (external link, opens in a new tab) speaks HTTP/1.1 over exactly one connection and leaves redirects, cookies, decompression, and retries to the caller — so little Python code runs per request. urllib.request (external link, opens in a new tab) adds redirects, proxies, and authentication, but builds a new connection with TLS handshake for every request. HTTP/2, HTTP/3, and asyncio are not provided.

requests

requests (external link, opens in a new tab) (2.34) is synchronous, speaks only HTTP/1.1, and delegates connection management to urllib3 (external link, opens in a new tab) (2.8); its feature set is frozen. It resolves redirects in Python — every hop goes through the full path of a request again. Without an explicit timeout, requests waits indefinitely. urllib3 alone is also included in the measurements.

httpx

httpx (external link, opens in a new tab) offers the requests API in a synchronous and an asynchronous variant, optionally with HTTP/2 — both protocols implemented in Python: HTTP/1.1 in h11 (external link, opens in a new tab), HTTP/2 in h2 (external link, opens in a new tab), connection management in httpcore (external link, opens in a new tab). The latest stable version is 0.28.1 (December 2024); the pre-releases of 1.0 represent a redesign (client and server in one package, with truststore (external link, opens in a new tab) as the only dependency).

niquests

niquests (external link, opens in a new tab) (3.21) is a fork of requests that speaks HTTP/1.1, HTTP/2, and HTTP/3 and multiplexes requests even in synchronous code. For that it replaces urllib3 with the fork urllib3-future (external link, opens in a new tab) and brings along packages by the same authors: jh2 (external link, opens in a new tab) (a fork of h2 (external link, opens in a new tab), still in Python), qh3 (external link, opens in a new tab) (a fork of aioquic (external link, opens in a new tab), now with a transport core in Rust), and wassima (external link, opens in a new tab) (system certificates). This makes niquests the shortest path from existing requests code to HTTP/2 and HTTP/3 — at the price of a dependency tree that comes almost entirely from a single source.

aiohttp

aiohttp (external link, opens in a new tab) (3.14) is the established asynchronous client and server for asyncio. The HTTP parser is accelerated in C, the protocol is HTTP/1.1; HTTP/2 and HTTP/3 are not supported, and there is no synchronous API.

curl_cffi

curl_cffi (external link, opens in a new tab) (0.17) binds curl-impersonate (external link, opens in a new tab) via cffi — a patched libcurl with BoringSSL (external link, opens in a new tab) that can mimic the TLS and HTTP/2 fingerprints of common browsers. It offers a requests-like API, asyncio, and WebSockets; its libcurl is statically built, and HTTP/3 comes from ngtcp2 (external link, opens in a new tab) and nghttp3 (external link, opens in a new tab).

pycurl

pycurl (external link, opens in a new tab) is the oldest libcurl binding, a thin layer over the C API (setopt, callbacks). The wheels from 7.48 (2026) onwards ship a libcurl with HTTP/3; WebSockets, the MIME API, and AsyncCurlMulti (asyncio via the multi-socket interface) are also included. The API is too low-level for application code; in the benchmark, a bare pycurl — one handle, minimal options, a list as write buffer — serves as a reference with minimal Python wrapper code.

The wheels bundle their own libcurl in pycurl.libs/; for 7.49.0, pycurl.version reports:

PycURL/7.49.0 libcurl/8.23.0 OpenSSL/3.6.5 zlib/1.3.1.zlib-ng brotli/1.2.1 libpsl/0.21.5 libssh2/1.11.1_DEV nghttp2/1.70.0 ngtcp2/1.25.0 nghttp3/1.18.0 mit-krb5/1.22.2

So HTTP/2 comes from nghttp2 1.70.0, HTTP/3 from ngtcp2 1.25.0 and nghttp3 1.18.0, and decompression covers zlib-ng and brotli — but not zstd (no libzstd is bundled).

Rust-based clients

pyreqwest (external link, opens in a new tab) (0.15) binds the Rust client reqwest (external link, opens in a new tab); HTTP/3 is still unstable in reqwest (there via quinn (external link, opens in a new tab)) and is therefore not exposed. Besides the asyncio variant there is one with reqwest’s multithreaded runtime (“pyreqwest (mt)” in the benchmark). rnet (external link, opens in a new tab) (3.0.0rc22, now developed further as wreq (external link, opens in a new tab)) and ry (external link, opens in a new tab) (0.0.106, on ryo3 (external link, opens in a new tab)) mimic browser fingerprints like curl_cffi; rnet brings BoringSSL (external link, opens in a new tab) for that. All three speak HTTP/1.1 and HTTP/2, not HTTP/3, and they declare no dependencies at the Python level; the crate tree of reqwest/wreq (tokio, rustls, quinn …) is compiled into the wheel (see the note on the overview table).

Overview

Library Version Sync Async HTTP/2 HTTP/3 Dependencies per PyPI metadata
http.client, urllib Python 3.14 yes no no no none
requests 2.34 yes no no no urllib3, certifi, idna, charset-normalizer
urllib3 2.8 yes no no no certifi, idna
httpx 0.28 yes yes optional no httpcore, h11, anyio, certifi, idna
niquests 3.21 yes yes yes yes urllib3-future, jh2, qh3, h11, wassima, charset-normalizer
aiohttp 3.14 no yes no no yarl, multidict, propcache, frozenlist, aiosignal, aiohappyeyeballs, attrs, idna
curl_cffi 0.17 yes yes yes yes cffi, certifi
pycurl 7.49 yes yes yes yes none
pyreqwest 0.15 yes yes yes no none
rnet 3.0.0rc22 yes yes yes no none
ry 0.0.106 yes yes yes no none
curlyshed 0.1 yes yes yes yes pycurl

The last column only lists the PyPI metadata. Native clients (pycurl, curl_cffi, pyreqwest, rnet, ry, qh3) show “none” there, but bundle their native dependency tree into the wheel — the crates of reqwest/wreq (tokio, rustls, quinn …), the statically built libcurl with BoringSSL and ngtcp2 in curl_cffi, the Rust transport core in qh3. Figure 2 in [4] shows this blind spot using the gallia package as an example: PyPI only records dependencies in its own ecosystem language; system libraries that Python packages need, such as OpenSSL, are missing from the manifests. For SBOMs and the Cyber Resilience Act, this bundled native tree counts.

curlyshed

curlyshed 0.1.0 (external link, opens in a new tab) is available on PyPI as curlyshed. It uses pycurl to provide a synchronous client (curlyshed.http.Client) and an asynchronous client (curlyshed.http.AsyncClient) with a shared configuration (ClientConfig), plus a requests-compatible layer (curlyshed.requests). All protocol functions — HTTP/1.1, HTTP/2, HTTP/3, redirects, cookies, decompression, Alt-Svc — come from libcurl; nothing is rebuilt in Python. Requirements: Python ≥ 3.14, pycurl ≥ 7.48, and libcurl ≥ 8.16 (the pycurl wheels bring 8.23 with OpenSSL, nghttp2, ngtcp2, and nghttp3).

Methodology

This article uses the November 5, 2026 re-run of the benchmark. It replaces the November 4 series and adds ry over HTTP/1.1 and curlyshed.requests over HTTP/3. See the benchmark instructions (external link, opens in a new tab) and raw data (external link, opens in a new tab).

Setup. Server and clients run in a Podman (external link, opens in a new tab) pod on the same machine (AMD EPYC 7763, KVM with 16 vCPUs, Linux 6.12; client image based on Debian forky): Caddy (external link, opens in a new tab) on localhost:8443 serves files (1 KiB, 1 MiB, 10 MiB, and 10 MiB of compressible text) as well as a chain of ten redirects, over HTTPS with HTTP/1.1, HTTP/2, and HTTP/3 (UDP); an echo server in Go on localhost:8444 mirrors POST bodies back, likewise over HTTP/1.1, 2, and 3. The certificates come from a local CA. The run comprises four shards. Sequential scenarios run without CPU pinning on all 16 vCPUs, one shard each for Python 3.14 and 3.14t. Concurrent scenarios use disjoint CPU sets: servers on CPUs 0–1 and client on 2–7 for 3.14, servers on 8–9 and client on 10–15 for 3.14t. Comparisons within each shard therefore share the same CPU allocation; comparisons between Python builds use different cores for concurrent scenarios. Python 3.15 was deliberately excluded because not all libraries were available, keeping the client set comparable across builds.

Sketch of the measurement setup: each shard has its own pod on the same machine; concurrent shards use separate CPU sets, while sequential shards run without pinning. Transfers use loopback (TCP and UDP for QUIC).

In the free-threaded build (3.14t, PEP 703), the results record whether the GIL was actually off; all successful Python-client measurements in this run report it disabled.

Scenarios. 16 scenarios: sequential GETs of 1 KiB; the same from 8 and 32 threads and with asyncio with 10, 50, and 200 requests in flight; downloads of 1 MiB (from 8 threads and with asyncio, 10 in flight) and 10 MiB (sequential); 10 MiB of text, transferred compressed where the client offers compression; a chain of ten redirects before a 1 KiB response; POST uploads of 10 KiB and 1 MiB (sequential) as well as 100 KiB from 8 threads and 100 KiB and 1 MiB with asyncio, 10 in flight to the echo server.

Procedure. Each measurement runs in a fresh process, warms up for 2 s (connections, TLS sessions, caches), and then counts completed requests for 5 s. Every response is checked: the HTTP version actually spoken and the body size; a deviation is an error, not a result. Each combination runs three times, with client runs interleaved to reduce the effect of drift. The median and range of successful runs are reported; failures are recorded separately. A result with two failures therefore represents only one successful run, not three; the figures and tables mark such cases. Per measurement, the CPU time per request (user + system across all threads of the process), the process’s peak RSS, and the garbage collections during the measurement are also recorded.

The clients run with their default settings; in the thread scenarios, the clients documented as thread-safe (urllib3, httpx, pyreqwest, rnet, ry) share one client, the others get one per thread. Two baselines are shown as references: bare pycurl (one handle per thread, minimal options, a list as write buffer; a CurlMulti loop for concurrency) and the curl command line (Debian forky’s curl 8.22.0, --parallel for threads and asyncio). Bare pycurl minimizes Python wrapper work; the command line runs without Python. Comparing curlyshed with bare pycurl helps estimate the cost of its wrapper, but differences in configuration, buffering, and callbacks can also affect the result. The command line provides a separate reference without the Python runtime. The re-run brings the baselines closer, but does not match them exactly: the curl CLI uses libcurl 8.22.0, the pycurl wheel 8.23.0; both use OpenSSL 3.6.5. Version and build differences remain a limitation.

Versions. Python 3.14.10, with and without the GIL; requests 2.34.2 with urllib3 2.8.0; httpx 0.28.1; niquests 3.21.2 with urllib3-future 2.25.905 and qh3 2.1.0; aiohttp 3.14.5; curl_cffi 0.17.0 with libcurl 8.23.0; pycurl 7.49.0 with the bundled libcurl 8.23.0 (build settings in the pycurl section); the curl CLI is Debian forky’s curl 8.22.0 with libcurl 8.22.0 and OpenSSL 3.6.5; pyreqwest 0.15.1; rnet 3.0.0rc22; ry 0.0.106; the curlyshed repository build used for the November 5 benchmark with libcurl 8.23.0 via pycurl 7.49.0.

Results

All figures show Python 3.14 unless noted otherwise, and for each client all measured HTTP versions; the values cited in the text are each the client’s best HTTP version unless a protocol is named explicitly. Differences in maxima across protocols should not be read as comparisons at a fixed HTTP version.

Sequential requests

Figure 1: Sequential GETs (1 KiB), by HTTP version, against Caddy, Python 3.14 (req/s; Median; line: smallest to largest of 3 runs)
Values as table
Client HTTP Median (req/s)Range
http.client 1.1 3,5253,522–3,592
urllib 1.1 581580–585
requests 1.1 1,3631,348–1,371
urllib3 1.1 2,4162,340–2,444
httpx 1.1 1,7681,732–1,788
httpx 2 1,2661,239–1,275
niquests 1.1 1,3671,359–1,371
niquests 2 1,1761,160–1,184
niquests 3 1,1371,110–1,146
curl_cffi 1.1 2,3812,370–2,459
curl_cffi 2 1,8401,803–1,891
curl_cffi 3 1,7041,689–1,737
pyreqwest 1.1 3,5043,491–3,677
pyreqwest 2 2,5382,345–2,568
pyreqwest (mt) 1.1 3,5583,126–3,591
pyreqwest (mt) 2 2,4312,229–2,498
rnet 1.1 3,9983,747–4,088
rnet 2 2,6372,597–3,042
ry 1.1 3,9683,693–4,045
ry 2 2,7392,382–2,753
curlyshed 1.1 3,8513,581–3,878
curlyshed 2 2,5582,307–2,559
curlyshed 3 2,4812,441–2,515
curlyshed.requests 1.1 2,5662,483–2,597
curlyshed.requests 2 1,8451,831–1,896
curlyshed.requests 3 1,7741,744–1,811
pycurl (reference) 1.1 4,2134,145–4,231
pycurl (reference) 2 2,7382,679–2,786
pycurl (reference) 3 2,6732,526–2,736
curl (CLI) (reference) 1.1 3,3883,255–3,571
curl (CLI) (reference) 2 2,3212,232–2,477
curl (CLI) (reference) 3 2,3262,295–2,404
Figure 2: CPU time per sequential request, by HTTP version, against Caddy, Python 3.14 (µs CPU time per request, lower is better; Median)
Values as table
Client HTTP CPU/request (µs)
http.client 1.1 133
urllib 1.1 1,189
requests 1.1 590
urllib3 1.1 267
httpx 1.1 443
httpx 2 549
niquests 1.1 589
niquests 2 645
niquests 3 666
curl_cffi 1.1 254
curl_cffi 2 291
curl_cffi 3 322
pyreqwest 1.1 102
pyreqwest 2 124
pyreqwest (mt) 1.1 119
pyreqwest (mt) 2 161
rnet 1.1 106
rnet 2 143
ry 1.1 101
ry 2 135
curlyshed 1.1 105
curlyshed 2 147
curlyshed 3 163
curlyshed.requests 1.1 229
curlyshed.requests 2 281
curlyshed.requests 3 303
pycurl (reference) 1.1 76
pycurl (reference) 2 116
pycurl (reference) 3 142
curl (CLI) (reference) 1.1 134
curl (CLI) (reference) 2 178
curl (CLI) (reference) 3 193

For sequential requests in this low-latency setup, client overhead strongly affects throughput. Figure 2 reports total client-process CPU time per request. Bare pycurl reaches 4,213 requests/s and 76 µs CPU per request. Among the higher-level clients, rnet (3,998) and ry (3,968) lead, followed by curlyshed (3,851, 105 µs), pyreqwest with its multithreaded runtime (3,558), and http.client (3,525). Curlyshed reaches 2.8× requests (1,363/s, 590 µs) and 2.2× httpx (1,768/s, 443 µs); urllib3 directly reaches 2,416 and curl_cffi 2,381 requests/s. Bare pycurl’s throughput is about 9 % higher than curlyshed’s. The difference is consistent with wrapper overhead, but these measurements do not isolate its individual sources. urllib reaches 581 requests/s and 1,189 µs CPU per request; it establishes a new connection with a TLS handshake for each request.

For these sequential results, the median garbage-collection counts also differ: curlyshed 8, bare pycurl 9, requests 2, http.client 7, httpx 136, and niquests 151. The corresponding peak RSS values range from about 29 MB for the curl CLI to 58 MB for rnet, with curlyshed at 42 MB.

Concurrency with asyncio

Figure 3: 50 requests in flight (asyncio), 1 KiB each, all HTTP versions, against Caddy, Python 3.14 (req/s; Median; line: smallest to largest of 3 runs)
Values as table
Client HTTP Median (req/s)Range
aiohttp 1.1 8,2658,199–8,474
httpx 1.1 343329–346
httpx 2 1,0651,059–1,071
niquests 1.1 1,5271,478–1,589
niquests 2 1,4921,491–1,568
niquests 3 1,4811,445–1,572
curl_cffi 1.1 4,8024,547–4,818
curl_cffi 2 5,0514,850–5,092
curl_cffi 3 5,1915,100–5,400
pyreqwest 1.1 9,9459,332–10,174
pyreqwest 2 6,9726,419–7,819
pyreqwest (mt) 1.1 9,4449,091–10,175
pyreqwest (mt) 2 6,7976,226–6,981
rnet 1.1 5,4624,827–5,733
rnet 2 4,8894,600–5,020
ry 1.1 14,57013,546–16,083
ry 2 8,7658,509–9,402
curlyshed 1.1 12,67312,598–13,215
curlyshed 2 8,2927,616–8,561
curlyshed 3 11,73411,541–12,088
pycurl (reference) 1.1 17,49616,138–17,978
pycurl (reference) 2 9,0788,388–10,026
pycurl (reference) 3 11,71911,413–12,695
curl (CLI) (reference) 1.1 13,96513,550–14,019
curl (CLI) (reference) 2 8,5888,461–8,709
curl (CLI) (reference) 3 12,23711,453–12,338
Figure 4: 200 requests in flight (asyncio), 1 KiB each, by HTTP version, against Caddy, Python 3.14 (req/s; Median; line: smallest to largest of 3 runs)
Values as table
Client HTTP Median (req/s)Range
aiohttp 1.1 7,9787,920–8,432
httpx 1.1 337239–371
httpx 2 1,0271,004–1,082
niquests 1.1 1,4531,429–1,454
niquests 2 1,3831,331–1,422
niquests 3 1,4061,349–1,470
curl_cffi 1.1 4,7284,653–4,931
curl_cffi 2 5,0654,967–5,355
curl_cffi 3 5,2895,256–5,361
pyreqwest 1.1 9,9389,040–10,168
pyreqwest 2 6,1095,537–6,965
pyreqwest (mt) 1.1 10,0379,166–10,500
pyreqwest (mt) 2 6,1015,747–7,155
rnet 1.1 5,0254,661–5,284
rnet 2 5,2834,476–5,643
ry 1.1 16,00715,979–16,077
ry 2 8,9868,915–9,256
curlyshed 1.1 13,33113,011–13,517
curlyshed 2 10,0747,945–10,600
curlyshed 3 11,72310,409–13,158
pycurl (reference) 1.1 16,08215,385–17,677
pycurl (reference) 2 10,9699,037–11,169
pycurl (reference) 3 11,58510,612–12,431
curl (CLI) (reference) 1.1 9,7289,214–10,550
curl (CLI) (reference) 2 10,1859,999–10,640
curl (CLI) (reference) 3 12,95411,112–13,233

With 50 requests in flight over HTTP/1.1, bare pycurl reaches 17,496 requests/s using a CurlMulti loop rather than asyncio. Among the asyncio clients, ry leads with 14,570 requests/s, ahead of curlyshed at 12,673, pyreqwest at 9,945, and aiohttp at 8,265. At 200 in flight, ry reaches 16,007 and curlyshed 13,331 requests/s. Curlyshed uses less client CPU per request: 79 µs at 50 and 75 µs at 200 in flight, against 108 µs for ry at both levels. Throughput and total CPU cost therefore give different rankings. The new HTTP/1.1 measurements matter: ry reaches only 8,765 and 8,986 requests/s over HTTP/2 at those concurrency levels. Over HTTP/3, curlyshed reaches 11,734 requests/s with 50 in flight and 11,723 with 200, at 64 and 63 µs CPU per request.

Two findings persist in the re-run. First, niquests stays near 1,400–1,500 requests/s across protocols and both concurrency levels on Python 3.14. This is consistent with a per-request bottleneck, but its source has not been isolated. Second, httpx over HTTP/1.1 drops from 1,768 requests/s sequentially to 343 at 50 and 337 at 200 in flight, with CPU time rising from 443 to about 2,900–3,000 µs per request. Over HTTP/2, it reaches 1,065 and 1,027 requests/s. Identifying the cause requires profiling or a targeted reproduction.

On Python 3.14t, pyreqwest with its multithreaded runtime leads the asyncio clients at both levels: 14,181 and 16,060 requests/s, followed by ry at 13,848 and 14,477 and curlyshed at 12,242 and 13,918.

Threads and the GIL

Figure 5: 8 threads, 1 KiB each, Python 3.14 (with GIL) and 3.14t (freethreading, without GIL) side by side per client, by HTTP version, against Caddy (req/s; Median; line: smallest to largest of 3 runs)
Values as table
Client HTTPPython Median (req/s)Range
http.client 1.13.14 5,9405,907–6,074
http.client 1.13.14t 14,44213,913–14,991
urllib 1.13.14 1,6791,632–1,794
urllib 1.13.14t 2,8892,762–2,945
requests 1.13.14 1,2331,187–1,267
requests 1.13.14t 6,1986,117–6,390
urllib3 1.13.14 2,9242,584–3,021
urllib3 1.13.14t 9,9759,731–10,324
httpx 1.13.14 1,1961,168–1,447
httpx 23.14 1,2491,154–1,368
niquests 1.13.14 1,2361,137–1,391
niquests 23.14 1,1721,144–1,213
niquests 33.14 991830–995
niquests 1.13.14t 4,6164,586–5,607
niquests 23.14t 4,3223,850–4,465
niquests 33.14t 4,2463,916–4,446
curl_cffi 1.13.14 1,2231,135–1,310
curl_cffi 23.14 1,2261,079–1,302
curl_cffi 33.14 1,2101,048–1,226
curl_cffi 1.13.14t 10,0129,817–10,727
curl_cffi 23.14t 7,3767,221–7,815
curl_cffi 33.14t 6,8276,643–6,916
pyreqwest 1.13.14 13,39313,382–13,722
pyreqwest 23.14 7,1926,342–7,545
pyreqwest 1.13.14t 13,54912,963–14,808
pyreqwest 23.14t 7,6407,328–7,948
pyreqwest (mt) 1.13.14 11,59911,320–11,803
pyreqwest (mt) 23.14 7,3825,963–7,934
pyreqwest (mt) 1.13.14t 12,19512,158–12,384
pyreqwest (mt) 23.14t 7,8487,775–7,889
rnet 1.13.14 12,25612,247–12,655
rnet 23.14 7,5567,089–7,843
rnet 1.13.14t 12,72612,140–13,658
rnet 23.14t 7,5887,524–7,777
ry 1.13.14 13,39612,748–13,497
ry 23.14 7,7697,626–7,924
ry 1.13.14t 13,24112,060–14,389
ry 23.14t 7,6117,578–7,907
curlyshed 1.13.14 6,7076,281–8,102
curlyshed 23.14 6,0435,600–6,427
curlyshed 33.14 6,2875,761–6,396
curlyshed 1.13.14t 14,63114,305–14,814
curlyshed 23.14t 7,9527,810–8,115
curlyshed 33.14t 8,2228,166–8,228
curlyshed.requests 1.13.14 3,0212,851–3,247
curlyshed.requests 23.14 2,8012,544–2,941
curlyshed.requests 33.14 2,8952,502–2,974
curlyshed.requests 1.13.14t 10,88510,595–11,081
curlyshed.requests 23.14t 7,2666,879–7,462
curlyshed.requests 33.14t 6,6736,512–7,032
pycurl (reference) 1.13.14 14,69813,623–14,821
pycurl (reference) 23.14 7,7087,420–8,082
pycurl (reference) 33.14 6,8776,600–7,861
pycurl (reference) 1.13.14t 13,91313,034–14,646
pycurl (reference) 23.14t 8,1537,000–8,167
pycurl (reference) 33.14t 7,2266,768–8,427
httpx 1.13.14t Error
httpx 23.14t Error

With 8 threads and the GIL (Python 3.14), bare pycurl reaches 14,698 requests/s; ry and pyreqwest reach about 13,396 and 13,393, and rnet 12,256. Curlyshed reaches 6,707 (317 µs CPU per request), requests 1,233, and curl_cffi 1,225. In Python 3.14t, curlyshed reaches 14,631 requests/s at 119 µs CPU per request, compared with 13,913 for bare pycurl. Requests rises from 1,233 to 6,198 requests/s, urllib3 from 2,924 to 9,975, curl_cffi from 1,225 to 10,011, and curlyshed.requests from 3,021 to 10,885. The curl CLI is omitted from Figure 5 because it is not a Python client; its separately measured results can still differ between shards.

With 32 threads, pyreqwest reaches 16,110 requests/s under the GIL, bare pycurl 15,508, and curlyshed 5,336. Without the GIL, pyreqwest reaches 16,785, ry 16,375, rnet 16,056, and curlyshed 14,167. Httpx with a shared client fails all three runs for both protocols with 8 threads on 3.14t. With 32 threads, HTTP/2 still fails all three; HTTP/1.1 has one successful run and two failures. This is a reproducibility finding for this setup, not a general claim about all httpx workloads.

The results suggest that Python callbacks limit curlyshed’s synchronous thread scaling under the GIL: processing headers and body chunks requires Python execution. Other native clients already scale with the GIL enabled, so this finding does not apply equally to every synchronous client.

Redirects

Figure 6: Ten redirects, then 1 KiB, by HTTP version, against Caddy, Python 3.14 (req/s; Median; line: smallest to largest of 3 runs)
Values as table
Client HTTP Median (req/s)Range
urllib 1.1 5554–55
requests 1.1 132131–134
urllib3 1.1 253250–253
httpx 1.1 189186–191
httpx 2 140138–141
niquests 1.1 126125–130
niquests 2 120115–120
niquests 3 104103–105
curl_cffi 1.1 497481–538
curl_cffi 2 319299–342
curl_cffi 3 272271–282
pyreqwest 1.1 612603–640
pyreqwest 2 379371–388
pyreqwest (mt) 1.1 565564–567
pyreqwest (mt) 2 352341–365
rnet 1.1 488487–517
rnet 2 330325–336
ry 1.1 509499–529
ry 2 339325–358
curlyshed 1.1 621606–628
curlyshed 2 336324–345
curlyshed 3 319309–326
curlyshed.requests 1.1 462457–469
curlyshed.requests 2 281279–288
curlyshed.requests 3 267250–275
pycurl (reference) 1.1 632616–642
pycurl (reference) 2 349323–366
pycurl (reference) 3 314311–329
curl (CLI) (reference) 1.1 600593–600
curl (CLI) (reference) 2 338336–338
curl (CLI) (reference) 3 309298–310

On a chain of ten redirects, bare pycurl reaches 632 requests/s, curlyshed 621, pyreqwest 611, and the curl command line 600; requests reaches 132, niquests 126, and urllib 55. The architectural effect is most visible here: libcurl and reqwest follow the redirects internally over the same connection, without returning to Python; requests, httpx, and niquests, in contrast, run the full Python path of a request for each hop.

Downloads and decompression

Figure 7: 10 MiB of text, transferred compressed, by HTTP version, against Caddy, Python 3.14 (MB/s; Median; line: smallest to largest of 3 runs)
http.client and urllib do not offer compression and download the 10 MiB uncompressed.
Values as table
Client HTTP Median (MB/s)Range
http.client 1.1 570537–616
urllib 1.1 526516–532
requests 1.1 566556–571
urllib3 1.1 530495–623
httpx 1.1 619595–707
httpx 2 610594–697
niquests 1.1 567547–586
niquests 2 529527–538
niquests 3 547542–578
curl_cffi 1.1 1,1971,167–1,203
curl_cffi 2 1,1091,024–1,122
curl_cffi 3 910890–933
pyreqwest 1.1 857825–862
pyreqwest 2 825796–878
pyreqwest (mt) 1.1 803763–853
pyreqwest (mt) 2 749726–792
rnet 1.1 927897–941
rnet 2 865834–880
ry 1.1 1,1061,092–1,132
ry 2 1,0541,019–1,095
curlyshed 1.1 1,2191,170–1,243
curlyshed 2 1,2011,180–1,204
curlyshed 3 1,1861,164–1,192
curlyshed.requests 1.1 708671–761
curlyshed.requests 2 680664–688
curlyshed.requests 3 692691–693
pycurl (reference) 1.1 867863–869
pycurl (reference) 2 795756–845
pycurl (reference) 3 1,0911,085–1,092
curl (CLI) (reference) 1.1 1,3171,316–1,324
curl (CLI) (reference) 2 1,2381,224–1,255
curl (CLI) (reference) 3 1,3121,309–1,332
Figure 8: Download of 10 MiB random data, by HTTP version, against Caddy, Python 3.14 (MB/s; Median; line: smallest to largest of 3 runs)
The server resets the HTTP/2 stream for curl_cffi in two of three runs on each Python build (curl error 92, INTERNAL_ERROR). All HTTP/3 runs complete.
Values as table
Client HTTP Median (MB/s)Range
http.client 1.1 621591–624
urllib 1.1 531487–608
requests 1.1 428400–432
urllib3 1.1 466462–544
httpx 1.1 422414–494
httpx 2 191165–203
niquests 1.1 565521–588
niquests 2 299288–311
niquests 3 260259–285
curl_cffi 1.1 726680–778
curl_cffi 2 323 (2 runs with errors)323–323
curl_cffi 3 317316–333
pyreqwest 1.1 622605–653
pyreqwest 2 292285–295
pyreqwest (mt) 1.1 633607–667
pyreqwest (mt) 2 306287–311
rnet 1.1 239204–240
rnet 2 266253–267
ry 1.1 634585–644
ry 2 316303–328
curlyshed 1.1 733698–743
curlyshed 2 312310–327
curlyshed 3 260257–284
curlyshed.requests 1.1 623602–665
curlyshed.requests 2 274266–295
curlyshed.requests 3 256254–276
pycurl (reference) 1.1 724711–747
pycurl (reference) 2 315311–324
pycurl (reference) 3 275262–279
curl (CLI) (reference) 1.1 765765–829
curl (CLI) (reference) 2 313291–331
curl (CLI) (reference) 3 322286–331

In the compressed download (Figure 7), the curl CLI reaches 1,317 MB/s, curlyshed 1,219, curl_cffi 1,197, ry 1,106, and bare pycurl 1,091. These are rates of the uncompressed response body, not bytes transferred on the wire. Decompression itself runs in native libraries such as zlib (external link, opens in a new tab) and brotli (external link, opens in a new tab). Differences in how clients feed and buffer data may contribute to the results. Total CPU time per request is 4,474 µs for the curl CLI and 7,359 µs for curlyshed, against 14,460 µs for requests. http.client and urllib transfer the text uncompressed, so they do not provide a comparison of decompression efficiency.

In the uncompressed 10 MiB download (Figure 8), the curl CLI reaches 765 MB/s, curlyshed 733, curl_cffi 726, and bare pycurl 724; requests reaches 428 and httpx over HTTP/1.1 422 MB/s. Curl_cffi’s HTTP/2 value comes from one successful run per build. Attributing the stream resets requires an isolated client/server reproduction.

Uploads

Figure 9: POST 10 KiB to the echo server, by HTTP version, Python 3.14 (req/s; Median; line: smallest to largest of 3 runs)
Values as table
Client HTTP Median (req/s)Range
http.client 1.1 4,1593,965–4,256
urllib 1.1 596589–599
requests 1.1 1,4601,434–1,485
urllib3 1.1 2,6602,570–2,799
httpx 1.1 1,7871,758–1,862
httpx 2 1,2171,163–1,241
niquests 1.1 1,3931,387–1,443
niquests 2 1,1401,130–1,150
niquests 3 915887–929
curl_cffi 1.1 2,6102,579–2,782
curl_cffi 2 1,8861,780–1,934
curl_cffi 3 1,6941,672–1,762
pyreqwest 1.1 3,9333,802–3,943
pyreqwest 2 2,5052,470–2,617
pyreqwest (mt) 1.1 3,6163,500–3,914
pyreqwest (mt) 2 2,3982,159–2,520
rnet 1.1 3,3802,906–3,550
rnet 2 2,3512,006–2,470
ry 1.1 4,3183,757–4,544
ry 2 2,4972,494–2,754
curlyshed 1.1 4,3624,049–4,462
curlyshed 2 2,5092,393–2,716
curlyshed 3 2,3742,310–2,383
curlyshed.requests 1.1 2,8752,858–2,887
curlyshed.requests 2 1,9681,727–1,992
curlyshed.requests 3 1,7441,702–1,834
pycurl (reference) 1.1 4,8514,694–5,443
pycurl (reference) 2 2,6122,572–2,881
pycurl (reference) 3 2,3892,387–2,610
curl (CLI) (reference) 1.1 3,7923,586–3,832
curl (CLI) (reference) 2 2,4442,276–2,483
curl (CLI) (reference) 3 2,2872,192–2,356

In the upload of 10 KiB per POST (Figure 9), bare pycurl reaches 4,851 requests/s, followed by curlyshed at 4,362, ry at 4,318, and http.client at 4,159. Curlyshed uses 125 µs CPU per request, compared with 95 µs for bare pycurl. Requests reaches 1,460 and niquests 1,393 requests/s. For sequential 1 MiB POSTs, the clients’ best protocol results range from 128 to 187 MB/s, with curlyshed at 187 and http.client at 186. Each POST is echoed back, so this scenario includes both upload and response transfer.

Cost of the compatibility layer

curlyshed.requests reaches 2,566 sequential requests/s against 3,851 for curlyshed’s own API (229 against 105 µs CPU per request). The requests-compatible object model therefore has a measurable cost in this setup. The re-run also measures this layer over HTTP/3.

HTTP/3

Availability. Of the clients examined, only niquests, curl_cffi, pycurl, and curlyshed speak HTTP/3; the others — requests, httpx, aiohttp, pyreqwest, rnet, ry, the standard library — do not, not even optionally.

QUIC implementations. The clients with HTTP/3 rely on two QUIC implementations: ngtcp2 in libcurl, with nghttp3 for HTTP/3 (curl_cffi, pycurl, and curlyshed), and qh3 (external link, opens in a new tab), a fork of aioquic (external link, opens in a new tab), in niquests. The Rust clients pyreqwest and ry bind reqwest (external link, opens in a new tab), whose experimental HTTP/3 support uses quinn (external link, opens in a new tab), but do not expose HTTP/3 in Python.

Choosing an HTTP/3 client also means choosing a QUIC implementation. Our server-side evaluation of 15 QUIC stacks [2] found substantial differences in how they implemented the tested RFC 9000 Security Considerations, extending the implementation-level perspective of our earlier literature and code study [1]. These results do not assess the Python clients examined here, but illustrate that QUIC implementations are not interchangeable. Unlike the widely shared TCP implementation in the Linux kernel, QUIC deployments use a range of independent stacks, each with its own performance characteristics, configuration, and maintenance. Optimizations and fixes therefore do not necessarily benefit the ecosystem as a whole.

The author would like to see a shared, tunable QUIC stack become widely available, potentially through an in-kernel implementation such as lxin/quic (external link, opens in a new tab). This is a direction for future development, rather than a conclusion of the server-side security evaluation; its benefits would require separate measurement.

Discussion

Explaining the performance differences

Over the loopback interface, network latency is low, making client processing costs more visible. CPU time per request (Figure 2) includes Python execution, native libraries, memory management, and synchronization across all client threads. It does not separate those contributions, and wall-clock time also includes waiting for the server and scheduling. The architectures suggest several explanations for the measured differences. Confirming their individual contributions would require profiling or controlled experiments:

  • Protocol work in native code: libcurl handles transfers internally, while callbacks and response objects still involve Python. Parsing headers only when read may reduce wrapper work; the measured total is 105 µs CPU per request for curlyshed against 76 µs for bare pycurl.
  • Redirects internal to libcurl, without returning to Python: 621 against 132 requests/s for requests (Figure 6).
  • Protocols in C (nghttp2, ngtcp2, nghttp3) instead of HTTP/2 frames in Python (h2, jh2) — noticeable per frame on multiplexed connections.
  • Scheduling in libcurl via the multi-socket interface of the async client may help explain its low CPU time per request at 50 and 200 in flight (Figures 3 and 4), while ry achieves higher throughput on Python 3.14.
  • Shared state (connections, TLS sessions, cookies) via libcurl’s share interface, without synchronization in Python.
  • Handle reuse with only the changed options per request.

For compressed downloads, curlyshed exceeds bare pycurl on 3.14, while bare pycurl leads on 3.14t. Buffering, callbacks, and transfer configuration may matter alongside the amount of Python code.

HTTP/3 often trails HTTP/1.1 on this loopback connection, but not in every case: bare pycurl’s compressed download is faster over HTTP/3 on 3.14, and curlyshed’s is slightly faster over HTTP/3 on 3.14t. These results do not support a universal protocol ranking. One plausible contributor is the QUIC processing path: encryption, acknowledgements, and congestion control run per packet in user space, while TCP benefits from kernel processing and, on physical networks, network-card offloads — consistent with Zhang et al., who measure up to 45 % less data rate than TCP with TLS and HTTP/2 [3]. This warmed-up loopback setup does not meaningfully evaluate HTTP/3’s potential advantages in connection setup, avoiding TCP’s cross-stream head-of-line blocking, or connection migration. Those require dedicated measurements with latency, packet loss, and path changes.

Limitations

  • Local measurement. What is measured is the effort in the client, not the network: with 50 ms latency, the difference between 2,000 and 6,000 sequential requests/s hardly matters, but with many concurrent requests, long redirect chains, and large downloads it does.
  • One virtual machine and shard allocation. Scheduling, shared host resources, and the shard allocations described in Methodology can affect comparisons between Python builds and between sequential and concurrent scenarios.
  • Defaults. The clients run with their default settings — that is what most applications use.
  • Failures. Httpx with a shared client is unreliable in the 3.14t thread scenarios; curl_cffi encounters HTTP/2 stream resets in two of three 10 MiB download runs on each build. These outcomes require isolated reproductions. Medians with failed runs summarize only the successful measurements.
  • Python versions. Python 3.15 is deliberately excluded because not all libraries were available; this series compares 3.14 and 3.14t with the same client set.
  • Different libcurl builds. The CLI and pycurl use different libcurl versions and build configurations. Isolating Python overhead would require matching those builds.
  • Bias. The author of this article is the author of curlyshed. Setup, scripts, and raw data are therefore open and reproducible.

Conclusion

Choosing a client

The right client depends on the application:

  • Existing requests applications: These results alone do not justify a migration. If network latency dominates, compatibility and maintenance may matter more than client overhead. niquests offers a familiar API with HTTP/2 and HTTP/3; curlyshed.requests provides a compatibility layer on libcurl, with measurable overhead compared with curlyshed’s own API.
  • Asyncio applications: aiohttp remains an established option for HTTP/1.1. For workloads dominated by many small requests, ry, curlyshed, and pyreqwest warrant a closer look: ry leads throughput on 3.14, pyreqwest with its multithreaded runtime on 3.14t, while curlyshed has low CPU cost per request. httpx offers synchronous and asynchronous APIs with HTTP/2, but its throughput degradation at high concurrency in this setup deserves investigation before drawing broader conclusions.
  • Many small requests at low latency: curlyshed, pyreqwest, rnet, and ry are promising candidates. Benchmark the actual workload, including response processing: the rankings here describe HTTP transfers against local servers.
  • HTTP/3: niquests, curl_cffi, and pycurl/curlyshed expose it. The choice also determines the QUIC implementation and its packaging. These loopback measurements do not establish which client performs best over networks with latency or packet loss.
  • Browser impersonation: curl_cffi, rnet, and ry provide capabilities that throughput measurements alone do not capture.

Before choosing, also consider supported Python versions, deployment requirements, timeouts, streaming, and the API features the application needs. A small benchmark of the intended workload is more useful than treating any single ranking here as universal.

Answering the research questions

RQ1 (Architecture). The clients examined can be grouped by the layer in which the protocol work happens (section Architectures): pure Python clients on sockets (http.client, urllib, requests with urllib3, httpx), Python with native components (aiohttp, niquests with urllib3-future, jh2, and qh3), clients on libcurl in C (pycurl, curl_cffi, curlyshed), and clients with a core in Rust (pyreqwest, rnet, ry). This layer is what matters for performance and behaviour, not the API.

RQ2 (Performance). No higher-level client leads every workload. Rnet and ry lead sequential GET throughput, ry leads the asyncio clients on 3.14, and pyreqwest with its multithreaded runtime leads them on 3.14t. Curlyshed combines low CPU cost with competitive throughput: 2.8× requests sequentially and 4.7× on ten redirects in this setup (sections Results and Explaining the performance differences). Native clients can scale with many threads under the GIL when most work happens outside Python. Clients with substantial Python work per request, including curlyshed’s synchronous wrapper, benefit strongly from free-threaded builds. The results are consistent with differences in Python overhead and native processing, but process CPU time alone does not isolate their contributions.

RQ3 (HTTP/3). From the clients’ side, HTTP/3 is available in niquests, curl_cffi, pycurl, and curlyshed (section HTTP/3); behind them are two QUIC stacks, ngtcp2 in libcurl and qh3 (an aioquic fork with a Rust transport core), while the Rust clients pyreqwest and ry bind reqwest with quinn but do not expose HTTP/3. Our server-side evaluation [2] illustrates substantial differences between QUIC implementations, without assessing the security of these Python clients. The ecosystem has no single shared reference stack, so implementation choice remains relevant and improvements do not automatically carry over between stacks. HTTP/3 often trails HTTP/1.1 here, with exceptions in individual workloads. This warmed-up loopback benchmark does not establish its value for connection setup, packet loss, or migration; those need dedicated network experiments.

Outlook

Still open are experiments with real latency, packet loss, and path changes, isolated reproductions of the observed failures, and baselines built with exactly matched libcurl versions and configuration. Feedback, bug reports, and measurement results from other machines are welcome, preferably as an issue in the benchmark repository (see Methodology).

References

  1. S. Tatschner, S. N. Peters, D. Emeis, J. Morris, T. Newe: A Quic(k) Security Overview: A Literature Research on Implemented Security Recommendations (external link, opens in a new tab). ARES 2023, ACM. Material: Zenodo (external link, opens in a new tab).
  2. S. N. Peters, L. Lautenschlager, S. Tatschner, K. Darowski, N. T. A. To, M. Buhl: A QUIC(k) Security Evaluation: A Server-Testbed for RFC Security Considerations (external link, opens in a new tab). ESORICS 2026, Springer LNCS. Material: Zenodo (external link, opens in a new tab).
  3. X. Zhang, S. Jin, Y. He, A. Hassan, Z. M. Mao, F. Qian, Z.-L. Zhang: QUIC is not Quick Enough over Fast Internet (external link, opens in a new tab). The Web Conference (WWW) 2024, ACM.
  4. S. Tatschner, M. P. Heinl, N. Pappler, T. Specht, S. Plaga, T. Newe: Tracking Down Software Cluster Bombs: A Current State Analysis of the FLOSS Ecosystem (external link, opens in a new tab). Preprint, arXiv:2502.08219. Material: Zenodo (external link, opens in a new tab).

AI tools assisted with the writing of this article.