nilo
Emerging · Zig · engine: nilo_http on zio · standard configuration · completeness 4/4
A toolkit for Zig 0.16 whose largest module is an HTTP/1.1 server on zio fibers (io_uring, epoll, kqueue). A plain function is a route: its argument list is the routing, the typed input, the 400 for anything that does not fit, and the OpenAPI document. One allocation per request, 4,669 bytes per idle connection, and a wait parks the fiber rather than the thread. Serves cleartext on 8080 and TLS 1.3 on 8081 from one process. Refuses HTTP/2, HTTP/3, gRPC and templates on the record, which is why it sits out those profiles.
Achievements
🥇 3 Gold · 🥈 3 Silver · 🥉 2 Bronze. 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 · WebSocket | 1 of 20 |
| 🥇 Gold | Test profile | WebSocket · Echo Pipelined | 1 of 17 |
| 🥇 Gold | Test profile | Workload · JSON TLS | 1 of 73 |
| 🥈 Silver | Family composite | Composite · HTTP/1.1 | 2 of 77 |
| 🥈 Silver | Test profile | Connection · Baseline | 2 of 77 |
| 🥈 Silver | Test profile | Connection · Short-lived | 2 of 77 |
| 🥉 Bronze | Test profile | Concurrency · Async Delay | 3 of 73 |
| 🥉 Bronze | Test profile | WebSocket · Echo | 3 of 20 |
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 | 2 of 77 | 6799 |
| WebSocket | 1 of 20 | 2567 |
Every result
Alpha Round, 20 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 | 2,984,774 | 1.37ms | 1.52ms | 6704.6% | 177MiB |
| Connection | Pipelined | 4,096 | 8,398,691 | 7.82ms | 12.70ms | 6190.9% | 149MiB |
| Connection | Short-lived | 4,096 | 2,290,416 | 1.77ms | 10.60ms | 6000.9% | 271MiB |
| Concurrency | Async Delay | 32,000 | 1,962,937 | 15.22ms | 29.60ms | 5348.9% | 905MiB |
| Efficiency | Latency-10K | 1,024 | 9,982 | 76.1us | 110.0us | 32.1% | 69MiB |
| Efficiency | Latency-1M | 1,024 | 998,061 | 120.9us | 207.0us | 3490.3% | 70MiB |
| Efficiency | Latency-500K/8 | 1,024 | 446,113 | 1055180.5us | 2165760.0us | 794.0% | 42MiB |
| Workload | JSON Comp | 4,096 | 275,376 | 14.81ms | 182.00ms | 6347.2% | 301MiB |
| Workload | JSON Comp | 16,384 | 266,447 | 29.03ms | 397.40ms | 5994.9% | 453MiB |
| Workload | JSON TLS | 4,096 | 1,324,032 | 3.24ms | 109.63ms | 6523.8% | 997MiB |
| Workload | 8Gbit | 512 | 49,186 | 110.1us | 150.0us | 433.5% | 129MiB |
| Database | Async DB | 1,024 | 67,779 | 14.77ms | 63.60ms | 930.5% | 157MiB |
| WebSocket | Echo | 512 | 3,573,673 | 142us | 277us | 6656.2% | 56MiB |
| WebSocket | Echo | 4,096 | 3,674,708 | 1.11ms | 1.77ms | 6588.8% | 171MiB |
| WebSocket | Echo | 16,384 | 3,072,807 | 4.47ms | 5.97ms | 6506.2% | 571MiB |
| WebSocket | Echo Pipelined | 512 | 52,899,977 | 154us | 252us | 6436.9% | 56MiB |
| WebSocket | Echo Pipelined | 4,096 | 52,821,408 | 1.24ms | 1.63ms | 6228.1% | 173MiB |
| WebSocket | Echo Pipelined | 16,384 | 45,043,421 | 5.02ms | 6.34ms | 6570.9% | 564MiB |
| WebSocket | Echo Short-lived | 512 | 1,162,948 | 372us | 1.36ms | 4006.7% | 90MiB |
| WebSocket | Echo Short-lived | 4,096 | 2,162,742 | 935us | 3.48ms | 5979.3% | 245MiB |
Compared with
The Zig entries around nilo on the HTTP/1.1 composite, and the one leading them. The last column shows every profile side by side.
| Entry | Composite | vs nilo | |
|---|---|---|---|
| swerver | 6825 | +0% | head to head |
| zix | 4839 | -29% | head to head |
| libxev | 3920 | -42% | head to head |
Compare nilo with any Zig entry · Compare nilo with any entry, in any language · Every Zig entry, ranked
Results updated · How the benchmark is run · The machine · Add or fix an entry