Skip to content

Commit 2eca676

Browse files
authored
bench(python): use pyperf strict mode over custom logic (#561)
1 parent ae2224e commit 2eca676

6 files changed

Lines changed: 428 additions & 716 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ maturin build --release
107107

108108
## Benchmark
109109

110-
Outperforms `requests`, `httpx`, `aiohttp`, and `curl_cffi`, and you can see the [benchmark](https://github.com/0x676e67/wreq-python/tree/main/bench) for details benchmark data is for reference only and actual performance may vary based on your environment and use case.
110+
Outperforms `requests`, `httpx`, `aiohttp`, and `curl_cffi`, and you can see the [benchmark](https://github.com/0x676e67/wreq-python/tree/main/bench) for details. The benchmark suite is driven by `pytest-benchmark`, and results are still for reference only because network and system conditions affect outcomes.
111111

112112
## Services
113113

bench/README.md

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,13 @@
22

33
benchmark between wreq and other python http clients
44

5-
6-
Machine
7-
------
8-
9-
```log
10-
..' MacBook
11-
,xNMM. ----------------
12-
.OMMMMo OS: macOS Sequoia 15.7.1 arm64
13-
lMM" Host: MacBook Pro (16-inch, Nov 2023, Three Thunderbolt 4)
14-
.;loddo:. .olloddol;. Kernel: Darwin 24.6.0
15-
cKMMMMMMMMMMNWMMMMMMMMMM0: Uptime: 300 days, 18 hours, 5 mins
16-
.KMMMMMMMMMMMMMMMMMMMMMMMWd. Packages: 117 (brew), 11 (brew-cask)
17-
XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: zsh 5.9
18-
;MMMMMMMMMMMMMMMMMMMMMMMM: Display (Color LCD): 3456x2234 @ 120 Hz (as 1728x1117) in]
19-
:MMMMMMMMMMMMMMMMMMMMMMMM: DE: Aqua
20-
.MMMMMMMMMMMMMMMMMMMMMMMMX. WM: Quartz Compositor
21-
kMMMMMMMMMMMMMMMMMMMMMMMMWd. WM Theme: Blue (Dark)
22-
'XMMMMMMMMMMMMMMMMMMMMMMMMMMk Font: .AppleSystemUIFont [System], Helvetica [User]
23-
'XMMMMMMMMMMMMMMMMMMMMMMMMK. Cursor: Fill - Black, Outline - White (32px)
24-
kMMMMMMMMMMMMMMMMMMMMMMd Terminal: iTerm 3.6.4
25-
;KMMMMMMMWXXWMMMMMMMk. Terminal Font: MesloLGS-NF-Regular (14pt)
26-
"cooc*" "*coo'" CPU: Apple M3 Max (16) @ 4.06 GHz
27-
GPU: Apple M3 Max (40) @ 1.38 GHz [Integrated]
28-
Memory: 41.12 GiB / 128.00 GiB (32%)
29-
Swap: Disabled
30-
Local IP (en0): 192.168.1.172/24
31-
Battery: 75% [AC connected]
32-
Power Adapter: 140W USB-C Power Adapter
33-
Locale: en_US.UTF-8
34-
```
35-
365
Sync clients
376
------
387

398
- curl_cffi
409
- requests
4110
- niquests
4211
- pycurl
43-
- [python-tls-client](https://github.com/FlorianREGAZ/Python-Tls-Client.git)
4412
- httpx
4513
- wreq
4614
- ry
@@ -64,12 +32,12 @@ All the clients run with session/client enabled.
6432
## Run benchmark
6533

6634
```bash
67-
# Install dependencies
68-
pip install -r requirements.txt
35+
# Install project + benchmark dependencies
36+
pip install -e .[bench]
6937

7038
# Start server
7139
python server.py
7240

73-
# Start benchmark
41+
# Run benchmark suite
7442
python benchmark.py
7543
```

0 commit comments

Comments
 (0)