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
🥇 11 Gold. 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 3 |
| 🥇 Gold | Family composite | Composite · HTTP/2 | 1 of 3 |
| 🥇 Gold | Test profile | Connection · Baseline | 1 of 3 |
| 🥇 Gold | Test profile | Connection · Short-lived | 1 of 3 |
| 🥇 Gold | Test profile | Efficiency · Latency-10K | 1 of 3 |
| 🥇 Gold | Test profile | Efficiency · Latency-1M | 1 of 3 |
| 🥇 Gold | Test profile | HTTP/2 · Baseline | 1 of 3 |
| 🥇 Gold | Test profile | HTTP/2 · Static | 1 of 3 |
| 🥇 Gold | Test profile | Workload · 8Gbit | 1 of 3 |
| 🥇 Gold | Test profile | Workload · JSON Comp | 1 of 3 |
| 🥇 Gold | Test profile | Workload · JSON TLS | 1 of 3 |
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 3 | 6825 |
| HTTP/2 | 1 of 3 | 3900 |
| HTTP/3 | 1 of 2 | 1950 |
| gRPC | 2 of 2 | 1084 |
Every result
Alpha Round, 27 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,665,627 | 1.12ms | 2.15ms | 6358.2% | 1.0GiB |
| Connection | Pipelined | 4,096 | 23,561,030 | 2.78ms | 3.65ms | 6790.9% | 1.0GiB |
| Connection | Short-lived | 4,096 | 2,620,134 | 1.47ms | 3.13ms | 6294.7% | 1.1GiB |
| Efficiency | Latency-10K | 1,024 | 9,983 | 64.7us | 98.0us | 32.2% | 1.0GiB |
| Efficiency | Latency-1M | 1,024 | 997,622 | 100.0us | 176.0us | 2453.5% | 1.0GiB |
| Workload | JSON Comp | 4,096 | 407,780 | 10.02ms | 28.00ms | 6389.7% | 1.1GiB |
| Workload | JSON Comp | 16,384 | 414,296 | 39.12ms | 74.10ms | 6308.1% | 1.2GiB |
| Workload | JSON TLS | 4,096 | 1,502,272 | 2.67ms | 65.13ms | 6541.8% | 1.3GiB |
| Workload | 8Gbit | 512 | 49,423 | 87.7us | 133.0us | 221.8% | 2.1GiB |
| Workload | Static TLS | 1,024 | 1,101,306 | 0.87ms | 15.30ms | 6428.3% | 1.1GiB |
| Database | Async DB | 1,024 | 369,867 | 2.12ms | 17.20ms | 3812.1% | 1.1GiB |
| Database | Fortunes | 1,024 | 290,894 | 1.49ms | 5.36ms | 3495.2% | 1.1GiB |
| HTTP/2 | Baseline | 256 | 3,878,127 | 5.60ms | 48.09ms | 5575.1% | 1.2GiB |
| HTTP/2 | Baseline | 1,024 | 4,203,408 | 19.14ms | 146.87ms | 6277.6% | 1.7GiB |
| HTTP/2 | Static | 256 | 1,134,540 | 7.00ms | 85.76ms | 6404.5% | 1.4GiB |
| HTTP/2 | Static | 1,024 | 1,083,152 | 28.16ms | 174.23ms | 6315.5% | 2.3GiB |
| HTTP/2 | Baseline (h2c) | 256 | 12,451,341 | 1.19ms | 8.43ms | 4325.0% | 1.1GiB |
| HTTP/2 | Baseline (h2c) | 1,024 | 12,505,467 | 4.35ms | 69.64ms | 4269.2% | 1.5GiB |
| HTTP/2 | Baseline (h2c) | 4,096 | 11,606,256 | 20.06ms | 192.10ms | 3949.0% | 3.0GiB |
| HTTP/2 | JSON (h2c) | 1,024 | 4,526,493 | 6.94ms | 41.02ms | 6464.6% | 1.5GiB |
| HTTP/2 | JSON (h2c) | 4,096 | 4,409,384 | 29.60ms | 180.35ms | 6346.4% | 3.1GiB |
| HTTP/3 | Baseline | 64 | 901,515 | 2.51ms | 7.11ms | 4225.3% | 1.2GiB |
| HTTP/3 | Static | 64 | 406,802 | 281us | 648us | 3604.2% | 1.2GiB |
| gRPC | Unary | 256 | 6,790,374 | 2.22ms | 15.16ms | 2745.0% | 1.6GiB |
| gRPC | Unary | 1,024 | 6,683,122 | 8.00ms | 33.50ms | 2867.1% | 2.0GiB |
| gRPC | Unary TLS | 256 | 753,772 | 3.42ms | 18.02ms | 883.2% | 665MiB |
| gRPC | Unary TLS | 1,024 | 3,669 | 7.28ms | 48.49ms | 87.3% | 501MiB |
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 | |
|---|---|---|---|
| zix | 4839 | -29% | head to head |
| libxev | 3920 | -43% | 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