Skip to content

pyronova: bump to v2.4.2#684

Open
ddxd wants to merge 2 commits into
MDA2AV:mainfrom
leocaolab:pyronova-v2.4.2
Open

pyronova: bump to v2.4.2#684
ddxd wants to merge 2 commits into
MDA2AV:mainfrom
leocaolab:pyronova-v2.4.2

Conversation

@ddxd
Copy link
Copy Markdown
Contributor

@ddxd ddxd commented May 3, 2026

What changed

Engine (v2.4.2 — leocaolab/pyronova)

  • PYRONOVA_WORKERS controls TPC thread count — previously the TPC thread count was driven by PYRONOVA_IO_WORKERS (a Tokio-level knob), while PYRONOVA_WORKERS was silently ignored in TPC mode. Now PYRONOVA_WORKERS is the correct lever, keeping semantics consistent with the non-TPC path.
  • Clippy fixestoo_many_arguments allows on TPC accept functions; get_first() instead of get(0).

Launcher

  • Sets PYRONOVA_WORKERS = sched_getaffinity() so all logical CPUs visible to the container are used. On a Threadripper 32C/64T host this is 64 threads vs. 32 (physical-core auto-detect in v2.3.1). Removes the PYRONOVA_IO_WORKERS override that was incorrectly controlling TPC thread count.

App

  • Per-interpreter pre-serialized bytes cache for /json/{count} and /json-comp/{count} routes. Each sub-interpreter maintains its own dict[tuple, bytes] (max 256 entries) — no lock contention, no Response object reuse. Cache stores compact json.dumps(..., separators=(",", ":")) bytes; each cache hit wraps in a fresh Response().
  • TLS multi-port fix (from v2.4.1): extra_tls_ports no longer accidentally applied the TLS acceptor to the plain-HTTP main port.

Test plan

  • cargo clippy clean
  • cargo test passes locally (52/52)
  • Docker image builds from v2.4.2 tag
  • /json/10 returns correct JSON payload
  • Local wrk baseline: ~420k req/s, json: ~379k req/s

🤖 Generated with Claude Code

- PYRONOVA_WORKERS now controls TPC thread count (was wrongly using
  PYRONOVA_IO_WORKERS which is semantically the Tokio async IO pool)
- Launcher sets PYRONOVA_WORKERS=sched_getaffinity() so all logical
  CPUs are used (64 on Threadripper 32C/64T, vs 32 physical in v2.3.1)
- Per-interpreter pre-serialized bytes cache for json/json-comp routes
  (256-entry cap, no lock contention between sub-interpreters)
- TLS multi-port fix: extra_tls_ports no longer applies TLS acceptor to
  the plain HTTP main port

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The pyronova repo moved from github.com/moomoo-tech to github.com/leocaolab.
GitHub redirects still resolve, but pin the canonical URL so the Arena CI
build and the framework metadata both reference the live org directly.
@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented May 25, 2026

/benchmark -f pyronova

@github-actions
Copy link
Copy Markdown
Contributor

👋 /benchmark request received. A collaborator will review and approve the run.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: pyronova | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 699,598 5237.4% 865MiB -34.9% -29.6%
baseline 4096 824,745 6406.0% 1023MiB -27.6% -28.6%
pipelined 512 3,159,744 6491.9% 825MiB +15.6% -32.9%
pipelined 4096 3,317,624 6399.7% 1008MiB +17.2% -24.3%
limited-conn 512 221,625 1941.4% 851MiB -71.6% -30.7%
limited-conn 4096 355,060 3034.2% 1.0GiB -62.3% -23.1%
json 4096 699,386 6299.5% 1.1GiB +112.4% -21.4%
json-comp 512 422,627 5760.8% 892MiB +168.2% -27.4%
json-comp 4096 445,207 6300.5% 1.1GiB +168.8% -21.4%
json-comp 16384 416,265 6557.4% 1.7GiB +156.1% -10.5%
json-tls 4096 682,359 6516.9% 1.2GiB +112.7% -20.0%
upload 32 2,723 1300.9% 1.8GiB +1.1% +5.9%
upload 256 2,561 1345.2% 2.3GiB +2.9% +4.5%
api-4 256 20,658 242.7% 129MiB +108.9% -39.4%
api-16 1024 47,559 819.4% 327MiB +32.7% -29.1%
static 1024 268,496 6536.8% 2.1GiB -1.4% -8.7%
static 4096 233,824 6480.9% 4.9GiB -2.9% +11.4%
static 6800 229,272 6547.9% 6.2GiB -4.0% +1.6%
async-db 1024 23,707 750.6% 891MiB -13.3% -27.5%
crud 4096 12,414 308.5% 1001MiB -0.1% -24.8%
baseline-h2 256 1,574,194 6205.3% 1.1GiB -39.1% -15.4%
baseline-h2 1024 1,425,009 6351.8% 1.5GiB -39.0% -16.7%
static-h2 256 249,947 6293.0% 1.7GiB +26.4% -15.0%
static-h2 1024 251,370 6026.7% 2.3GiB +34.1% -4.2%
unary-grpc 256 5,226,329 6078.3% 1.2GiB +22.5% -14.3%
unary-grpc 1024 4,175,627 6421.6% 1.8GiB +29.1% -10.0%
unary-grpc-tls 256 5,115,606 6014.1% 1.1GiB +24.3% -21.4%
unary-grpc-tls 1024 4,034,437 6218.2% 1.6GiB +27.8% -15.8%
Full log
time for connect:        0us         0us         0us         0us     0.00%
time to 1st byte:        0us         0us         0us         0us     0.00%
req/s           :       0.00        0.00        0.00        0.00   100.00%
[info] CPU 97.8% | Mem 570MiB

[run 2/3]
starting benchmark...
.
1Main benchmark duration is started for thread #62.
7.
46.
TLS Protocol: TLSv1.3
Cipher: TLS_AES_128_GCM_SHA256
Server Temp Key: X25519 253 bits
Application protocol: h2
40Main benchmark duration is started for thread #42.
.
.
19.
0. Stopping all clients.
. Stopping all clients.


finished in 5.03s, 5146300.00 req/s, 186.51MB/s
requests: 25731500 total, 25757100 started, 25731500 done, 25731500 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 25731500 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 932.56MB (977859511) total, 98.20MB (102967216) headers (space savings 95.18%), 171.78MB (180120500) data
                     min         max         mean         sd        +/- sd
time for request:      752us     19.40ms      4.87ms      2.26ms    64.30%
time for connect:     2.71ms     39.47ms     16.48ms      7.15ms    66.80%
time to 1st byte:    10.16ms     51.39ms     28.82ms      6.93ms    71.09%
req/s           :    9519.24    46590.79    20100.71     9053.42    78.13%
[info] CPU 6014.1% | Mem 1.1GiB

[run 3/3]
starting benchmark...
.Warm-up phase is over for thread #Main benchmark duration is started for thread #11.
17.

.Main benchmark duration is started for thread #Warm-up phase is over for thread #54.

27Warm-up phase is over for thread #.
.Main benchmark duration is started for thread #40.

30.
TLS Protocol: TLSv1.3
Cipher: TLS_AES_128_GCM_SHA256
Server Temp Key: X25519 253 bits
Application protocol: h2
35. Stopping all clients.
25. Stopping all clients.
59. Stopping all clients.

finished in 5.04s, 5119640.00 req/s, 185.55MB/s
requests: 25598200 total, 25623800 started, 25598200 done, 25598200 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 25598200 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 927.73MB (972793747) total, 97.69MB (102434016) headers (space savings 95.18%), 170.89MB (179187400) data
                     min         max         mean         sd        +/- sd
time for request:      784us     25.63ms      4.91ms      2.14ms    64.38%
time for connect:     3.54ms     28.19ms     13.77ms      6.01ms    59.38%
time to 1st byte:    14.37ms     36.62ms     24.92ms      4.09ms    69.14%
req/s           :    8498.21    50957.14    19996.80     8521.34    80.08%
[info] CPU 5991.1% | Mem 1.2GiB

=== Best: 5115606 req/s (CPU: 6014.1%, Mem: 1.1GiB) ===
[info] saved results/unary-grpc-tls/256/pyronova.json
httparena-bench-pyronova
httparena-bench-pyronova

==============================================
=== pyronova / unary-grpc-tls / 1024c (tool=h2load) ===
==============================================
[info] waiting for server...
[info] gRPC server ready

[run 1/3]
starting benchmark...
42.
.
49.
15.
53. Stopping all clients.
47Stopped all clients for thread #30
. Stopping all clients.
33. Stopping all clients.
39
29

finished in 5.01s, 0.00 req/s, 0B/s
requests: 0 total, 0 started, 0 done, 0 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 0 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 0B (0) total, 0B (0) headers (space savings 0.00%), 0B (0) data
                     min         max         mean         sd        +/- sd
time for request:        0us         0us         0us         0us     0.00%
time for connect:        0us         0us         0us         0us     0.00%
time to 1st byte:        0us         0us         0us         0us     0.00%
req/s           :       0.00        0.00        0.00        0.00   100.00%
[info] CPU 98.2% | Mem 572MiB

[run 2/3]
starting benchmark...
34.

15.
progress: Warm-up phase is over for thread #2516.
% of clients started
% of clients started
TLS Protocol: TLSv1.3
Cipher: TLS_AES_128_GCM_SHA256
Server Temp Key: X25519 253 bits
Application protocol: h2
40. Stopping all clients.
40Stopped all clients for thread #3

4

. Stopping all clients.

finished in 5.07s, 4090920.00 req/s, 148.30MB/s
requests: 20454600 total, 20557000 started, 20454600 done, 20454600 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 20454600 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 741.48MB (777496192) total, 78.19MB (81983264) headers (space savings 95.17%), 136.55MB (143182200) data
                     min         max         mean         sd        +/- sd
time for request:      919us    131.31ms     23.71ms      8.34ms    74.37%
time for connect:     3.06ms    156.02ms     67.07ms     39.51ms    56.93%
time to 1st byte:     9.09ms    204.75ms    130.13ms     46.03ms    60.74%
req/s           :    2338.72     8597.00     3993.90     1079.95    87.01%
[info] CPU 6218.2% | Mem 1.6GiB

[run 3/3]
starting benchmark...
progress: 25Warm-up phase is over for thread #% of clients started14
.
5.

TLS Protocol: TLSv1.3
Cipher: TLS_AES_128_GCM_SHA256
Server Temp Key: X25519 253 bits
Application protocol: h2
24. Stopping all clients.
. Stopping all clients.
5. Stopping all clients.
2. Stopping all clients.
61. Stopping all clients.
61

finished in 5.07s, 4090480.00 req/s, 148.28MB/s
requests: 20452400 total, 20554800 started, 20452400 done, 20452400 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 20452400 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 741.40MB (777412384) total, 78.18MB (81974464) headers (space savings 95.17%), 136.53MB (143166800) data
                     min         max         mean         sd        +/- sd
time for request:     1.09ms     81.52ms     23.43ms      7.40ms    72.38%
time for connect:     3.94ms    133.03ms     55.64ms     33.61ms    55.96%
time to 1st byte:    32.29ms    178.96ms    113.67ms     34.83ms    74.02%
req/s           :    2378.95     7299.30     3993.66      907.63    71.39%
[info] CPU 6417.7% | Mem 1.8GiB

=== Best: 4034437 req/s (CPU: 6218.2%, Mem: 1.6GiB) ===
[info] saved results/unary-grpc-tls/1024/pyronova.json
httparena-bench-pyronova
httparena-bench-pyronova
[info] skip: pyronova does not subscribe to stream-grpc
[info] skip: pyronova does not subscribe to stream-grpc-tls
[info] skip: pyronova does not subscribe to echo-ws
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-16-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-4-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/async-db-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-h2-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-h2-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/crud-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-16384.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-tls-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-6800.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-h2-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-h2-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/unary-grpc-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/unary-grpc-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/unary-grpc-tls-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/unary-grpc-tls-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-32.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
httparena-postgres
httparena-redis
[info] restoring loopback MTU to 65536
[info] restoring CPU governor → powersave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants