barejs
Emerging · TS · engine: bun · standard configuration · completeness 4/4
JIT-specialized web framework for Bun with zero-allocation context pooling, built-in compression middleware, static file handler, and native WebSocket routing.
Achievements
🥇 2 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 · HTTP/3 | 1 of 17 |
| 🥇 Gold | Within its language | TS · HTTP/1.1 | 1 of 6 |
| 🥈 Silver | Test profile | HTTP/3 · Baseline | 2 of 17 |
| 🥈 Silver | Test profile | HTTP/3 · Static | 2 of 17 |
| 🥈 Silver | Test profile | WebSocket · Echo Short-lived | 2 of 23 |
| 🥉 Bronze | Test profile | HTTP/2 · JSON (h2c) | 3 of 29 |
| 🥉 Bronze | Test profile | WebSocket · Echo | 3 of 31 |
Composite rank
Each profile of a family is worth 1,000 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 | 6 of 88 | 7018 |
| HTTP/2 | 5 of 34 | 2498 |
| HTTP/3 | 1 of 17 | 1133 |
| WebSocket | 4 of 31 | 2552 |
| Database | 4 of 8 | 912 |
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.
| Suite | Tool | Passed | Failed |
|---|---|---|---|
| HTTP/1.1 | http11probe d50d818 | 133 of 159 (83.6%) | 26 |
| HTTP/2 | h2spec 2.6.0 | 144 of 146 (98.6%) | 2 |
| HTTP/3 | h3spec v0.1.15 | 64 of 81 (79.0%) | 17 |
| WebSocket | autobahn-testsuite 25.10.1 | 244 of 244 (100%) | 0 |
HTTP/1.1: what failed
| Test | Expected | Got |
|---|---|---|
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 = warn | 505, connection closed |
RFC9112-2.3-HTTP09-REQUEST HTTP/0.9 request (no version) must be rejected (RFC 9112 §2.3, SHOULD) | 400/close/timeout | 505, connection closed |
RFC9110-5.4-DUPLICATE-HOST Duplicate Host headers with different values must be rejected (RFC 9112 §3.2, MUST) | 400 | 200, connection left open |
COMP-DUPLICATE-HOST-SAME Duplicate Host headers with identical values must be rejected (RFC 9112 §3.2, MUST) | 400 | 200, connection left open |
COMP-HOST-WITH-USERINFO Host header with userinfo (user@host) must be rejected (RFC 9112 §3.2, MUST) | 400 or close | 200, connection left open |
COMP-HOST-WITH-PATH Host header with path component must be rejected (RFC 9112 §3.2, MUST) | 400 or close | 200, 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 = warn | 400, connection closed |
COMP-METHOD-CONNECT CONNECT to an origin server must be rejected (RFC 9110 §9.3.6, SHOULD) | 400/405/501 or close | 404, connection left open |
COMP-HOST-EMPTY-VALUE Empty Host header value must be rejected (RFC 9112 §3.2, MUST) | 400 or close | 200, 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 = warn | 505, connection closed |
COMP-VERSION-MISSING-MINOR HTTP/1 with no minor version digit is invalid (RFC 9112 §2.3, MUST) | 400, close, or timeout = warn | 505, 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 = warn | 505, connection closed |
COMP-VERSION-WHITESPACE HTTP/ 1.1 — whitespace inside version token is invalid (RFC 9112 §2.3, MUST) | 400, close, or timeout = warn | 505, connection closed |
COMP-CHUNKED-TRAILER-VALID Valid chunked body with trailer field should be accepted (RFC 9112 §7.1.2, MUST) | 2xx + echo | 200, 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 response | 100, connection closed |
COMP-VERSION-CASE HTTP version is case-sensitive — lowercase 'http' must be rejected (RFC 9112 §2.3, MUST) | 400, close, or timeout = warn | 505, connection closed |
COMP-SPACE-IN-TARGET Whitespace inside request-target is invalid (RFC 9112 §3.2, MUST) | 400, close, or timeout = warn | 505, 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 close | 200, 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 close | 200, connection left open |
SMUG-MULTIPLE-HOST-COMMA Host header with comma-separated values must be rejected (RFC 9110 §7.2, MUST) | 400 or close | 200, connection left open |
MAL-NUL-IN-URL NUL byte in URL should be rejected (MUST) | 400 or close | 505, connection closed |
MAL-LONG-METHOD 100KB method name should be rejected (SHOULD) | 400, 501 or close | 431, connection closed |
MAL-NON-ASCII-URL Non-ASCII bytes (UTF-8 é) in URL must be rejected (MUST) | 400 or close | 404, connection left open |
MAL-URL-OVERLONG-UTF8 Overlong UTF-8 encoding of / (0xC0 0xAF) in URL must be rejected (MUST) | 400 or close | 404, connection left open |
MAL-CHUNK-EXT-64K 64KB chunk extension — tests extension length limits (CVE-2023-39326 class) (NOTAPPLICABLE) | 400 or 2xx | 413, connection closed |
HTTP/2: what failed
| Test | Expected | Got |
|---|---|---|
http2/3.5/2 Sends invalid connection preface | GOAWAY Frame (Error Code: PROTOCOL_ERROR) or Connection closed | Error: unexpected EOF |
http2/6.9.1/3 Sends multiple WINDOW_UPDATE frames increasing the flow control window to above 2^31-1 on a stream | RST_STREAM Frame (Error Code: FLOW_CONTROL_ERROR) | RST_STREAM Frame (length:4, flags:0x00, stream_id:1) |
HTTP/3: what failed
| Test | Expected | Got |
|---|---|---|
| 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, 34 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 | 1,939,825 | 2.11ms | 4.13ms | 6730.8% | 1.5GiB |
| Connection | Pipelined | 4,096 | 3,504,600 | 18.70ms | 26.30ms | 6442.4% | 1.4GiB |
| Connection | Short-lived | 4,096 | 1,703,563 | 2.39ms | 8.37ms | 6542.4% | 1.5GiB |
| Concurrency | Async Delay | 32,000 | 1,837,923 | 17.41ms | 24.60ms | 6372.9% | 1.9GiB |
| Concurrency | CON-1M | 1,000,000 | 250,000 | 84.4us | 171.0us | 1051.8% | 5.0GiB |
| Concurrency | CON-1M-TLS | 1,000,000 | 249,956 | 88.0us | 193.0us | 1747.9% | 8.6GiB |
| Efficiency | Latency-10K | 1,024 | 9,978 | 83.0us | 119.0us | 43.8% | 859MiB |
| Efficiency | Latency-1M | 1,024 | 997,871 | 126.1us | 430.0us | 3517.3% | 1.2GiB |
| Workload | JSON Comp | 4,096 | 272,140 | 15.04ms | 32.20ms | 6303.8% | 1.6GiB |
| Workload | JSON Comp | 16,384 | 272,878 | 59.95ms | 97.40ms | 6182.1% | 1.7GiB |
| Workload | JSON TLS | 4,096 | 1,088,845 | 3.75ms | 39.90ms | 6555.3% | 1.4GiB |
| Workload | 8Gbit | 512 | 49,349 | 112.5us | 199.0us | 430.5% | 1.1GiB |
| Workload | Static TLS | 1,024 | 414,886 | 2.63ms | 29.01ms | 6571.7% | 1.7GiB |
| Database | Async DB | 1,024 | 250,048 | 4.09ms | 14.00ms | 3253.7% | 916MiB |
| Database | Fortunes | 1,024 | 46,117 | 22.21ms | 41.20ms | 3291.2% | 1.2GiB |
| HTTP/2 | Baseline | 256 | 7,670,813 | 3.22ms | 9.85ms | 6147.9% | 1.7GiB |
| HTTP/2 | Baseline | 1,024 | 7,714,852 | 12.63ms | 30.81ms | 6483.0% | 1.7GiB |
| HTTP/2 | Static | 256 | 576,747 | 14.55ms | 44.68ms | 6501.9% | 2.0GiB |
| HTTP/2 | Static | 1,024 | 571,042 | 55.25ms | 145.35ms | 6464.1% | 2.2GiB |
| HTTP/2 | Baseline (h2c) | 256 | 7,864,373 | 3.20ms | 10.65ms | 6281.4% | 1.7GiB |
| HTTP/2 | Baseline (h2c) | 1,024 | 7,996,673 | 12.25ms | 29.51ms | 6431.7% | 1.8GiB |
| HTTP/2 | Baseline (h2c) | 4,096 | 7,736,849 | 49.03ms | 91.07ms | 6471.3% | 1.8GiB |
| HTTP/2 | JSON (h2c) | 1,024 | 2,350,392 | 13.77ms | 32.70ms | 6484.0% | 1.5GiB |
| HTTP/2 | JSON (h2c) | 4,096 | 2,313,765 | 54.22ms | 102.42ms | 6516.0% | 1.6GiB |
| HTTP/3 | Baseline | 64 | 3,597,311 | 972us | 2.37ms | 3896.4% | 1.5GiB |
| HTTP/3 | Static | 64 | 274,726 | 15.43ms | 100.34ms | 5423.6% | 1.9GiB |
| WebSocket | Echo | 512 | 3,896,423 | 130us | 370us | 6370.6% | 1.0GiB |
| WebSocket | Echo | 4,096 | 4,112,239 | 996us | 2.16ms | 6251.2% | 1.0GiB |
| WebSocket | Echo | 16,384 | 3,898,543 | 4.20ms | 8.40ms | 6098.6% | 1.1GiB |
| WebSocket | Echo Pipelined | 512 | 42,759,846 | 190us | 514us | 6562.7% | 1.5GiB |
| WebSocket | Echo Pipelined | 4,096 | 43,622,009 | 1.50ms | 3.05ms | 6420.5% | 1.5GiB |
| WebSocket | Echo Pipelined | 16,384 | 41,036,323 | 6.39ms | 8.95ms | 6299.4% | 1.6GiB |
| WebSocket | Echo Short-lived | 512 | 2,248,493 | 190us | 692us | 5613.4% | 1.2GiB |
| WebSocket | Echo Short-lived | 4,096 | 2,539,588 | 1.38ms | 3.00ms | 5979.1% | 1.4GiB |
Compared with
The TS web frameworks around barejs 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.
| Entry | Composite | vs barejs | |
|---|---|---|---|
| bun | 5078 | -28% | head to head |
| elysia | 3544 | -49% | head to head |
Compare barejs with any TS entry · Compare barejs with any entry, in any language · Every TS entry, ranked
Results updated · How the benchmark is run · The machine · Add or fix an entry