HttpArena

bun

Flagship · TS · standard configuration · completeness 3/4

Bun.serve, Bun's own HTTP server, with no framework on top and one process per core sharing the ports. The same routes serve every protocol: HTTP/1.1 on 8080 and over TLS on 8081, h2c on 8082 and h2 plus HTTP/3 on 8443 through Bun's experimental `http2: true` and `http3: true` flags (QUIC is Bun's own lsquic, no proxy in front).

Achievements

🥇 1 Gold · 🥈 2 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.

MedalAwardFieldRank
🥇 GoldTest profileHTTP/3 · Static1 of 17
🥈 SilverWithin its languageTS · HTTP/1.12 of 6
🥈 SilverTest profileWorkload · JSON Comp2 of 84
🥉 BronzeFamily compositeComposite · HTTP/33 of 17
🥉 BronzeTest profileHTTP/3 · Baseline3 of 17

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.113 of 883834
HTTP/26 of 342354
HTTP/33 of 171098

Protocol compliance

The conformance suites this entry subscribes to, run against it on the benchmark machine: Http11Probe on HTTP/1.1, h2spec on HTTP/2, h3spec on HTTP/3 and Autobahn on WebSocket. A score, not part of the composite. How it works.

SuiteToolPassedFailed
HTTP/1.1http11probe d50d818133 of 159 (83.6%)26
HTTP/2h2spec 2.6.0144 of 146 (98.6%)2
HTTP/3h3spec v0.1.1564 of 81 (79.0%)17

HTTP/1.1: what failed

TestExpectedGot
RFC9112-2.2-BARE-LF-REQUEST-LINE Bare LF in request line should be rejected, but MAY be accepted (RFC 9112 §2.2, MAY)400 or close (pass), 2xx (warn)505, connection closed
RFC9112-3-CR-ONLY-LINE-ENDING CR without LF as line ending must be rejected (RFC 9112 §2.2, MUST)400, close, or timeout = warn505, connection closed
RFC9112-2.3-HTTP09-REQUEST HTTP/0.9 request (no version) must be rejected (RFC 9112 §2.3, SHOULD)400/close/timeout505, connection closed
RFC9110-5.4-DUPLICATE-HOST Duplicate Host headers with different values must be rejected (RFC 9112 §3.2, MUST)400200, connection left open
COMP-DUPLICATE-HOST-SAME Duplicate Host headers with identical values must be rejected (RFC 9112 §3.2, MUST)400200, connection left open
COMP-HOST-WITH-USERINFO Host header with userinfo (user@host) must be rejected (RFC 9112 §3.2, MUST)400 or close200, connection left open
COMP-HOST-WITH-PATH Host header with path component must be rejected (RFC 9112 §3.2, MUST)400 or close200, connection left open
COMP-OPTIONS-STAR OPTIONS * is the only valid asterisk-form request (RFC 9112 §3.2.4, MUST)2xx or 405; close/timeout = warn400, connection closed
COMP-METHOD-CONNECT CONNECT to an origin server must be rejected (RFC 9110 §9.3.6, SHOULD)400/405/501 or close404, connection left open
COMP-HOST-EMPTY-VALUE Empty Host header value must be rejected (RFC 9112 §3.2, MUST)400 or close200, connection left open
COMP-REQUEST-LINE-TAB Tab as request-line delimiter — SHOULD reject but MAY parse on whitespace (RFC 9112 §3, SHOULD)400 or 2xx; close/timeout = warn505, connection closed
COMP-VERSION-MISSING-MINOR HTTP/1 with no minor version digit is invalid (RFC 9112 §2.3, MUST)400, close, or timeout = warn505, connection closed
COMP-VERSION-LEADING-ZEROS HTTP/01.01 — leading zeros in version digits are invalid (RFC 9112 §2.3, MUST)400, close, or timeout = warn505, connection closed
COMP-VERSION-WHITESPACE HTTP/ 1.1 — whitespace inside version token is invalid (RFC 9112 §2.3, MUST)400, close, or timeout = warn505, connection closed
COMP-CHUNKED-TRAILER-VALID Valid chunked body with trailer field should be accepted (RFC 9112 §7.1.2, MUST)2xx + echo200, connection closed (Echo mismatch: expected "hello", got "helloHTTP/1.1 400 Bad Request Connectio...")
COMP-NO-1XX-HTTP10 Server must not send 1xx responses to an HTTP/1.0 client (RFC 9110 §15.2, MUST)non-1xx response100, connection closed
COMP-VERSION-CASE HTTP version is case-sensitive — lowercase 'http' must be rejected (RFC 9112 §2.3, MUST)400, close, or timeout = warn505, connection closed
COMP-SPACE-IN-TARGET Whitespace inside request-target is invalid (RFC 9112 §3.2, MUST)400, close, or timeout = warn505, connection closed
SMUG-CHUNK-BARE-SEMICOLON Chunk size with bare semicolon and no extension name must be rejected (RFC 9112 §7.1.1, MUST)400 or close200, connection left open
SMUG-CHUNK-EXT-INVALID-TOKEN Chunk extension with invalid token character must be rejected (RFC 9112 §7.1.1, MUST)400 or close200, connection left open
SMUG-MULTIPLE-HOST-COMMA Host header with comma-separated values must be rejected (RFC 9110 §7.2, MUST)400 or close200, connection left open
MAL-NUL-IN-URL NUL byte in URL should be rejected (MUST)400 or close505, connection closed
MAL-LONG-METHOD 100KB method name should be rejected (SHOULD)400, 501 or close431, connection closed
MAL-NON-ASCII-URL Non-ASCII bytes (UTF-8 é) in URL must be rejected (MUST)400 or close404, connection left open
MAL-URL-OVERLONG-UTF8 Overlong UTF-8 encoding of / (0xC0 0xAF) in URL must be rejected (MUST)400 or close404, connection left open
MAL-CHUNK-EXT-64K 64KB chunk extension — tests extension length limits (CVE-2023-39326 class) (NOTAPPLICABLE)400 or 2xx413, connection closed

HTTP/2: what failed

TestExpectedGot
http2/3.5/2 Sends invalid connection prefaceGOAWAY Frame (Error Code: PROTOCOL_ERROR) or Connection closedError: unexpected EOF
http2/6.9.1/3 Sends multiple WINDOW_UPDATE frames increasing the flow control window to above 2^31-1 on a streamRST_STREAM Frame (Error Code: FLOW_CONTROL_ERROR)RST_STREAM Frame (length:4, flags:0x00, stream_id:1)

HTTP/3: what failed

TestExpectedGot
QUIC servers MUST send FRAME_ENCODING_ERROR if a frame is cut short [Transport 12.4]-predicate failed on expected exception: QUICException / TransportErrorIsReceived InternalError "connection error"
QUIC servers MUST send CRYPTO_BUFFER_EXCEEDED if CRYPTO data is buffered beyond the limit [Transport 7.5]-did not get expected exception: QUICException
QUIC servers MUST send unexpected_message TLS alert if KeyUpdate in 1-RTT is received [TLS 6]-did not get expected exception: QUICException
HTTP/3 servers MUST send H3_MESSAGE_ERROR if a pseudo-header is duplicated [HTTP/3 4.3.1]-did not get expected exception: QUICException
HTTP/3 servers MUST send H3_MESSAGE_ERROR if mandatory pseudo-header fields are absent [HTTP/3 4.3.1]-did not get expected exception: QUICException
HTTP/3 servers MUST send H3_MESSAGE_ERROR if prohibited pseudo-header fields are present [HTTP/3 4.3]-did not get expected exception: QUICException
HTTP/3 servers MUST send H3_MESSAGE_ERROR if pseudo-header fields exist after fields [HTTP/3 4.3]-did not get expected exception: QUICException
HTTP/3 servers MUST treat a request with connection as malformed [HTTP/3 4.2]-did not get expected exception: QUICException
HTTP/3 servers MUST treat a request with keep-alive as malformed [HTTP/3 4.2]-did not get expected exception: QUICException
HTTP/3 servers MUST treat a request with proxy-connection as malformed [HTTP/3 4.2]-did not get expected exception: QUICException
HTTP/3 servers MUST treat a request with transfer-encoding as malformed [HTTP/3 4.2]-did not get expected exception: QUICException
HTTP/3 servers MUST treat a request with upgrade as malformed [HTTP/3 4.2]-did not get expected exception: QUICException
HTTP/3 servers MUST treat a request with te as malformed [HTTP/3 4.2]-did not get expected exception: QUICException
HTTP/3 servers MUST send H3_FRAME_ERROR if a SETTINGS frame stops mid-parameter [HTTP/3 7.1]-did not get expected exception: QUICException
HTTP/3 servers treats a repeated setting identifier as an error whatever its value [HTTP/3 7.2.4]-did not get expected exception: QUICException
HTTP/3 servers MUST send H3_ID_ERROR if GOAWAY goes up [HTTP/3 5.2]-did not get expected exception: QUICException
HTTP/3 servers MUST NOT buffer an over-long frame on a control stream [HTTP/3 7.1]-did not get expected exception: QUICException

Every result

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

CategoryProfileConnsReq/secAvgp99CPUMemory
ConnectionBaseline4,0961,926,3862.13ms3.84ms6737.0%1.2GiB
ConnectionPipelined4,0965,529,92811.85ms15.20ms6393.6%328MiB
ConnectionShort-lived4,0961,672,4442.43ms8.61ms6283.0%1.1GiB
ConcurrencyAsync Delay32,0001,949,53216.33ms22.30ms6385.5%1.5GiB
EfficiencyLatency-10K1,0249,98282.4us125.0us54.0%394MiB
EfficiencyLatency-1M1,024997,935140.7us429.0us4730.8%967MiB
WorkloadJSON Comp4,096460,7168.87ms20.90ms6322.9%1.1GiB
WorkloadJSON Comp16,384460,81635.22ms61.00ms6179.2%1.1GiB
WorkloadJSON TLS4,0961,081,7083.80ms41.48ms6292.0%966MiB
Workload8Gbit51249,237105.5us180.0us397.7%476MiB
WorkloadStatic TLS1,024481,4072.28ms62.40ms6530.9%1.0GiB
HTTP/2Baseline2567,062,1663.54ms20.48ms6283.7%1.2GiB
HTTP/2Baseline1,0247,059,84113.46ms84.78ms6272.8%1.3GiB
HTTP/2Static256613,74814.32ms87.71ms6332.3%1.2GiB
HTTP/2Static1,024599,95751.83ms249.17ms6387.3%1.4GiB
HTTP/2Baseline (h2c)2567,306,7853.59ms23.23ms6203.3%1.3GiB
HTTP/2Baseline (h2c)1,0247,402,05113.25ms53.30ms6388.6%1.3GiB
HTTP/2Baseline (h2c)4,0967,262,66152.79ms150.50ms6177.6%1.3GiB
HTTP/2JSON (h2c)1,0242,245,99014.67ms67.74ms6289.2%1.0GiB
HTTP/2JSON (h2c)4,0962,218,79356.52ms178.21ms6221.8%1.1GiB
HTTP/3Baseline643,435,0341.04ms2.51ms3616.5%1.0GiB
HTTP/3Static64289,58714.81ms138.14ms5306.5%1.3GiB

Compared with

The TS web frameworks around bun 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.

EntryCompositevs bun
barejs4819+26%head to head
elysia2668-30%head to head
hono-bun2296-40%head to head

Compare bun with any TS entry · Compare bun with any entry, in any language · Every TS entry, ranked

Results updated · How the benchmark is run · The machine · Add or fix an entry