fib
Experimental · Go · standard configuration · completeness 2/4
fib (Fast In Balance) Go networking library: one edge-triggered epoll event loop feeding a logical worker pool, where each connection is an ordered task that any idle worker may run. Its http package serves HTTP/1.1, HTTP/2 (ALPN and prior-knowledge h2c) and, through package http3, HTTP/3 over its own QUIC, all through one handler taking a *http.Request and a Context; TLS through package tls on crypto/tls. Default configuration throughout; the certificate on the opt-in TLS hardening listener is picked per handshake through tls.Config.GetCertificate, so a renewed pair is served without a restart. Handlers dispatch on the path themselves; the JSON routes sit behind fib's compress middleware (middleware.Chain with compress.New(), defaults), which gzips per request as Accept-Encoding allows. /delay and /async-db answer retained requests from a timer and a goroutine, and /static goes through net/http's ServeContent on the Context, choosing the pre-compressed twin on disk off Accept-Encoding.
Achievements
🥇 1 Gold · 🥈 2 Silver · 🥉 5 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 | Test profile | Efficiency · Latency-10K | 1 of 4 |
| 🥈 Silver | Test profile | WebSocket · Echo Pipelined | 2 of 4 |
| 🥈 Silver | Test profile | Workload · 8Gbit | 2 of 4 |
| 🥉 Bronze | Family composite | Composite · WebSocket | 3 of 4 |
| 🥉 Bronze | Test profile | Concurrency · Async Delay | 3 of 4 |
| 🥉 Bronze | Test profile | WebSocket · Echo | 3 of 4 |
| 🥉 Bronze | Test profile | WebSocket · Echo Short-lived | 3 of 4 |
| 🥉 Bronze | Test profile | Workload · JSON Comp | 3 of 4 |
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 | 4 of 5 | 2820 |
| HTTP/2 | 2 of 2 | 429 |
| HTTP/3 | 1 of 2 | 812 |
| WebSocket | 3 of 4 | 885 |
Every result
Alpha Round, 32 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 | 628,696 | 6.53ms | 28.00ms | 3746.8% | 199MiB |
| Connection | Pipelined | 4,096 | 4,397,680 | 14.55ms | 356.80ms | 2974.7% | 284MiB |
| Connection | Short-lived | 4,096 | 298,742 | 13.69ms | 28.70ms | 2196.9% | 141MiB |
| Concurrency | Async Delay | 32,000 | 923,898 | 34.35ms | 43.40ms | 3221.0% | 387MiB |
| Efficiency | Latency-10K | 1,024 | 9,983 | 79.0us | 110.0us | 42.1% | 48MiB |
| Efficiency | Latency-1M | 1,024 | 675,784 | 3111960.7us | 6375424.0us | 3123.7% | 134MiB |
| Efficiency | Latency-500K/8 | 1,024 | 343,710 | 3145726.4us | 6174720.0us | 742.5% | 50MiB |
| Workload | JSON Comp | 4,096 | 166,080 | 24.61ms | 86.80ms | 4448.9% | 486MiB |
| Workload | JSON Comp | 16,384 | 183,750 | 87.21ms | 366.60ms | 4355.8% | 806MiB |
| Workload | JSON TLS | 4,096 | 360,652 | 39.57ms | 960.52ms | 4530.6% | 340MiB |
| Workload | 8Gbit | 512 | 49,247 | 224.3us | 1301.0us | 601.5% | 98MiB |
| Workload | Static TLS | 1,024 | 219,570 | 16.06ms | 293.76ms | 4327.0% | 168MiB |
| Database | Async DB | 1,024 | 77,428 | 12.75ms | 29.20ms | 3480.6% | 154MiB |
| HTTP/2 | Baseline | 256 | 788,478 | 30.81ms | 345.90ms | 3923.7% | 198MiB |
| HTTP/2 | Baseline | 1,024 | 977,750 | 91.82ms | 1.47s | 4282.4% | 490MiB |
| HTTP/2 | Static | 256 | 99,177 | 80.19ms | 1.07s | 3172.4% | 330MiB |
| HTTP/2 | Static | 1,024 | 118,753 | 254.08ms | 2.51s | 3441.4% | 647MiB |
| HTTP/2 | Baseline (h2c) | 256 | 721,716 | 34.14ms | 382.93ms | 3857.7% | 164MiB |
| HTTP/2 | Baseline (h2c) | 1,024 | 1,005,391 | 94.28ms | 904.18ms | 4518.4% | 367MiB |
| HTTP/2 | Baseline (h2c) | 4,096 | 1,243,452 | 278.06ms | 3.05s | 4997.2% | 578MiB |
| HTTP/2 | JSON (h2c) | 1,024 | 208,563 | 150.92ms | 1.35s | 3791.2% | 260MiB |
| HTTP/2 | JSON (h2c) | 4,096 | 319,977 | 361.45ms | 2.90s | 4354.4% | 675MiB |
| HTTP/3 | Baseline | 64 | 677,620 | 4.36ms | 31.24ms | 2934.1% | 116MiB |
| HTTP/3 | Static | 64 | 39,451 | 56.73ms | 1.05s | 993.7% | 237MiB |
| WebSocket | Echo | 512 | 1,187,938 | 430us | 1.01ms | 2287.6% | 50MiB |
| WebSocket | Echo | 4,096 | 1,358,437 | 3.02ms | 4.34ms | 2555.4% | 92MiB |
| WebSocket | Echo | 16,384 | 1,139,164 | 14.04ms | 16.50ms | 2407.4% | 196MiB |
| WebSocket | Echo Pipelined | 512 | 14,722,476 | 555us | 1.45ms | 3042.9% | 55MiB |
| WebSocket | Echo Pipelined | 4,096 | 18,352,537 | 3.57ms | 5.21ms | 3883.9% | 90MiB |
| WebSocket | Echo Pipelined | 16,384 | 15,720,467 | 16.32ms | 19.00ms | 2884.0% | 203MiB |
| WebSocket | Echo Short-lived | 512 | 427,200 | 1.06ms | 2.01ms | 1043.7% | 68MiB |
| WebSocket | Echo Short-lived | 4,096 | 480,632 | 6.99ms | 22.00ms | 1213.2% | 124MiB |
Compared with
The Go entries around fib on the HTTP/1.1 composite, and the one leading them. The last column shows every profile side by side.
| Entry | Composite | vs fib | |
|---|---|---|---|
| fiber-tuned | 6394 | +127% | head to head |
| go-fasthttp | 3234 | +15% | head to head |
| fib-tuned | 2844 | +1% | head to head |
| echo | 2295 | -19% | head to head |
| gin | 2266 | -20% | head to head |
Compare fib with any Go entry · Compare fib with any entry, in any language · Every Go entry, ranked
Results updated · How the benchmark is run · The machine · Add or fix an entry