swerver
Experimental · Zig · tuned configuration · completeness 3/4
Experimental Zig web framework built directly on swerver's Router, HandlerContext, middleware, response, and static-file APIs. No pre-computed response bodies (pre-encoded registry off); JSON is serialized per request through ctx.jsonValue; unary gRPC is decoded and encoded per request over h2c and TLS h2; async-db and fortunes use the native async PostgreSQL client (pipelining, prepared-statement cache, park/resume). Single-threaded event loop per worker, SO_REUSEPORT fork fan-out, one multi-listener process for HTTP/1.1, HTTP/2, HTTP/3 (QUIC), kqueue, epoll, and io_uring backends.
Achievements
🥇 14 Gold · 🥈 2 Silver. Top three of a field, taken in this entry's own league: the family composite, the same composite among entries written in the same language, and each test profile it is scored on. Every field is the one the badges publish, so a medal and a badge always say the same thing. How medals are awarded.
| Medal | Award | Field | Rank |
|---|---|---|---|
| 🥇 Gold | Family composite | Composite · HTTP/1.1 | 1 of 8 |
| 🥇 Gold | Family composite | Composite · HTTP/2 | 1 of 5 |
| 🥇 Gold | Family composite | Composite · HTTP/3 | 1 of 4 |
| 🥇 Gold | Test profile | Connection · Baseline | 1 of 8 |
| 🥇 Gold | Test profile | Connection · Short-lived | 1 of 8 |
| 🥇 Gold | Test profile | HTTP/2 · Baseline | 1 of 5 |
| 🥇 Gold | Test profile | HTTP/2 · Baseline (h2c) | 1 of 4 |
| 🥇 Gold | Test profile | HTTP/2 · JSON (h2c) | 1 of 4 |
| 🥇 Gold | Test profile | HTTP/2 · Static | 1 of 5 |
| 🥇 Gold | Test profile | HTTP/3 · Baseline | 1 of 4 |
| 🥇 Gold | Test profile | HTTP/3 · Static | 1 of 4 |
| 🥇 Gold | Test profile | Workload · 8Gbit | 1 of 7 |
| 🥇 Gold | Test profile | Workload · JSON Comp | 1 of 7 |
| 🥇 Gold | Test profile | Workload · JSON TLS | 1 of 7 |
| 🥈 Silver | Test profile | Concurrency · Async Delay | 2 of 6 |
| 🥈 Silver | Test profile | Efficiency · Latency-1M | 2 of 7 |
Composite rank
Each profile of a family is worth 100 to the entry that leads it, and the composite is the sum over the family, less 2.5% for each of routing, middleware, request and response the entry does not do for you - its completeness factor, which the WebSocket and gRPC families do not carry. The field is this entry's own league: engines and reverse proxies are scored apart from frameworks. How it works.
| Family | Rank | Composite |
|---|---|---|
| HTTP/1.1 | 1 of 8 | 7632 |
| HTTP/2 | 1 of 5 | 3900 |
| HTTP/3 | 1 of 4 | 1950 |
| gRPC | 1 of 2 | 1790 |
Every result
Alpha Round, 28 runs. Requests per second is the best of three; latency, CPU and memory come from that run.
| Category | Profile | Conns | Req/sec | Avg | p99 | CPU | Memory |
|---|---|---|---|---|---|---|---|
| Connection | Baseline | 4,096 | 3,668,682 | 1.12ms | 2.17ms | 6284.5% | 1.0GiB |
| Connection | Pipelined | 4,096 | 23,068,272 | 2.84ms | 3.67ms | 6796.8% | 1.0GiB |
| Connection | Short-lived | 4,096 | 2,629,113 | 1.46ms | 3.18ms | 6306.6% | 1.1GiB |
| Concurrency | Async Delay | 32,000 | 1,710,592 | 18.52ms | 21.20ms | 3968.6% | 1.4GiB |
| Efficiency | Latency-10K | 1,024 | 9,974 | 76.6us | 102.0us | 31.9% | 1.0GiB |
| Efficiency | Latency-1M | 1,024 | 997,842 | 96.2us | 175.0us | 2511.7% | 1.0GiB |
| Workload | JSON Comp | 4,096 | 421,012 | 9.70ms | 27.70ms | 6303.1% | 1.1GiB |
| Workload | JSON Comp | 16,384 | 414,281 | 39.24ms | 74.90ms | 6262.9% | 1.2GiB |
| Workload | JSON TLS | 4,096 | 1,510,149 | 2.65ms | 55.48ms | 6545.7% | 1.3GiB |
| Workload | 8Gbit | 512 | 49,355 | 96.5us | 125.0us | 215.5% | 2.1GiB |
| Workload | Static TLS | 1,024 | 1,108,097 | 0.88ms | 28.20ms | 6404.6% | 1.1GiB |
| Database | Async DB | 1,024 | 374,347 | 2.06ms | 13.00ms | 3865.6% | 1.1GiB |
| Database | Fortunes | 1,024 | 296,284 | 1.52ms | 4.92ms | 3953.2% | 1.0GiB |
| HTTP/2 | Baseline | 256 | 4,027,974 | 4.76ms | 36.38ms | 5647.9% | 1.2GiB |
| HTTP/2 | Baseline | 1,024 | 4,188,242 | 16.31ms | 115.19ms | 6073.4% | 1.6GiB |
| HTTP/2 | Static | 256 | 1,137,287 | 6.91ms | 41.96ms | 6482.3% | 1.5GiB |
| HTTP/2 | Static | 1,024 | 1,085,942 | 28.17ms | 171.84ms | 6517.0% | 2.3GiB |
| HTTP/2 | Baseline (h2c) | 256 | 12,624,758 | 1.19ms | 8.24ms | 4421.1% | 1.1GiB |
| HTTP/2 | Baseline (h2c) | 1,024 | 12,774,896 | 4.18ms | 61.07ms | 4525.1% | 1.5GiB |
| HTTP/2 | Baseline (h2c) | 4,096 | 11,605,652 | 19.88ms | 202.30ms | 4091.3% | 3.0GiB |
| HTTP/2 | JSON (h2c) | 1,024 | 4,557,366 | 6.88ms | 63.86ms | 6502.6% | 1.5GiB |
| HTTP/2 | JSON (h2c) | 4,096 | 4,434,190 | 29.53ms | 295.96ms | 6280.0% | 3.1GiB |
| HTTP/3 | Baseline | 64 | 890,094 | 2.24ms | 6.72ms | 4233.1% | 1.1GiB |
| HTTP/3 | Static | 64 | 420,864 | 281us | 659us | 3708.7% | 1.2GiB |
| gRPC | Unary | 256 | 6,821,807 | 2.21ms | 36.16ms | 2802.0% | 1.6GiB |
| gRPC | Unary | 1,024 | 6,767,120 | 7.74ms | 35.13ms | 2963.3% | 2.0GiB |
| gRPC | Unary TLS | 256 | 3,552,155 | 5.08ms | 38.33ms | 5506.6% | 1.6GiB |
| gRPC | Unary TLS | 1,024 | 3,614,786 | 16.49ms | 114.07ms | 5845.2% | 2.1GiB |
Compared with
The Zig entries around swerver on the HTTP/1.1 composite, and the one leading them. The last column shows every profile side by side.
| Entry | Composite | vs swerver | |
|---|---|---|---|
| nilo | 6810 | -11% | head to head |
| zix | 4839 | -37% | head to head |
Compare swerver with any Zig entry · Compare swerver with any entry, in any language · Every Zig entry, ranked
Results updated · How the benchmark is run · The machine · Add or fix an entry