HttpArena

nilo

Experimental · Zig · engine: nilo_http on zio · standard configuration · completeness 4/4

A toolkit for Zig 0.17 whose largest module is an HTTP 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 HTTP/1.1 and h2c on 8080, TLS 1.3 on 8081, h2c on 8082 and HTTP/2 over TLS with ALPN on 8443 from one process. HTTP/2 and unary gRPC are behind the -Dhttp2 build flag, which this entry builds with; gRPC is unary only, so the streaming profiles are not subscribed. Refuses HTTP/3 and templates on the record, which is why it sits out those profiles.

Achievements

🥈 4 Silver · 🥉 1 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.

MedalAwardFieldRank
🥈 SilverWithin its languageZig · HTTP/1.12 of 4
🥈 SilverWithin its languageZig · HTTP/22 of 3
🥈 SilverWithin its languageZig · WebSocket2 of 4
🥈 SilverTest profileEfficiency · Latency-10K2 of 30
🥉 BronzeTest profilegRPC · Unary3 of 8

Composite rank

Each profile of a family is worth its weight × 1,000 to the entry that leads it - 1, or 0.5 apiece for two profiles that measure one thing - 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.

FamilyRankComposite
HTTP/1.110 of 324633
HTTP/211 of 181628
gRPC5 of 81313
WebSocket10 of 232454

Every result

Alpha Round, 31 runs. Requests per second is the best of three; latency, CPU and memory come from that run.

CategoryProfileConnsReq/secAvgp99CPUMemory
ConnectionBaseline4,0963,076,5501.33ms1.52ms6693.6%171MiB
ConnectionPipelined4,09612,006,2305.47ms11.00ms6548.0%140MiB
ConnectionShort-lived4,0962,301,6471.76ms10.60ms5868.5%261MiB
ConcurrencyAsync Delay32,0001,973,47015.13ms28.00ms4898.7%1002MiB
EfficiencyLatency-10K1,0249,98372.6us103.0us24.9%66MiB
EfficiencyLatency-1M1,024997,605103.9us180.0us2745.5%68MiB
WorkloadJSON Comp4,096611,3766.69ms31.20ms6598.4%321MiB
WorkloadJSON Comp16,384594,33119.67ms179.00ms6547.5%496MiB
WorkloadJSON TLS4,0961,561,9273.09ms309.41ms6303.1%653MiB
Workload8Gbit51249,266102.7us144.0us272.5%120MiB
HTTP/2Baseline2567,267,8744.06ms24.26ms6442.7%111MiB
HTTP/2Baseline1,0248,912,07014.40ms120.50ms6164.7%227MiB
HTTP/2Static256862,1919.29ms25.11ms6541.1%1.4GiB
HTTP/2Static1,024201,561155.29ms253.54ms6225.3%686MiB
HTTP/2Baseline (h2c)2569,010,3102.67ms11.03ms6446.2%57MiB
HTTP/2Baseline (h2c)1,0247,234,45113.47ms46.11ms6369.0%142MiB
HTTP/2Baseline (h2c)4,0966,873,41356.66ms146.15ms6440.6%253MiB
HTTP/2JSON (h2c)1,0241,409,45422.23ms94.60ms1507.4%359MiB
HTTP/2JSON (h2c)4,0961,387,43387.83ms327.18ms1787.2%894MiB
gRPCUnary2566,357,4623.65ms9.96ms6459.6%423MiB
gRPCUnary1,0246,706,91210.99ms197.47ms6382.7%1006MiB
gRPCUnary TLS2562,126,79412.95ms113.54ms6405.4%626MiB
gRPCUnary TLS1,0243,391,33745.16ms561.80ms6238.6%2.1GiB
WebSocketEcho5124,111,406123us161us6575.9%47MiB
WebSocketEcho4,0963,995,8151.02ms1.78ms6515.9%145MiB
WebSocketEcho16,3843,466,5263.98ms5.84ms6480.0%478MiB
WebSocketEcho Pipelined51261,071,888133us190us6309.6%47MiB
WebSocketEcho Pipelined4,09658,610,8641.12ms1.73ms6284.8%151MiB
WebSocketEcho Pipelined16,38450,919,0694.37ms6.12ms6211.1%503MiB
WebSocketEcho Short-lived5121,192,006351us1.29ms3619.4%96MiB
WebSocketEcho Short-lived4,0962,139,768637us2.15ms5619.1%220MiB

Compared with

The experimental Zig frameworks around nilo on the HTTP/1.1 composite, and the one leading them. Entries of other leagues are left out: a composite does not carry from one league to another. The last column shows every profile side by side.

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