workerd — Engineering Performance
63 engineers all time · Jan 2025 – Nov 2026 · built 2026-11-22 · GitHub
Performance snapshot
Today's rolling 90-day reading for workerd, compared with the start of the series. Pick a window to move that comparison point.
Avg. perf / dev / mo
+616.8%
0.37 → 2.64 ETV
Active engineers
−16.2%
37.0 → 31.0
Features
−15.4pp
43.9% → 28.5%
vs. Cloudflare
1.2x
0.88x → 1.2x · +17% above
workerd vs. Cloudflare
Per-engineer ETV for workerd against Cloudflare as a whole. Both lines are 90-day rolling averages scaled to a 30-day month, so they share one axis and can be read against each other at any point. Pick a window to zoom the chart to it.
Performance Composition
Each month's output split by type of work: Features (new value), Maintenance (sustaining systems), Tests, Docs, and Fixes (rework). The yellow line is output per engineer, so when it rises each engineer is delivering more, whatever the team size did. Unit: Engineering Throughput Value (ETV).
Engineering capacity
Effective engineers behind workerd, against its pre-AI baseline. Each subject has its own: workerd's is 0.40 ETV / dev / mo, its first reading in Q1 2025. Per-engineer ETV divided by that gives a capacity multiple, and that multiple applied to the engineers active in the trailing 90 days turns it into engineer-equivalents. The line is the real headcount, so the gap between line and area is what the leverage is worth. Because each baseline is its own, every subject opens at 1.0x on its first day: multiples measure improvement and are not comparable between subjects.
Knowledge concentration
How dependent is this repo on a small number of engineers? Higher top-1 share = higher key-person risk.
James M Snell owns 28.4 % of commits.
Behind the numbers
Written summary of the work completed each month.
No monthly reports available yet.
Top engineers
Most impactful commits
Top 10 by ETV in the all-time window.
- 28.0ETVin-tree workerd-cxx as src/rust/cxx Copy of current sources (preserving license files) massaged to be built in workerd.Mike Aizatsky · 201d4c13 · 2026-08-11
- 11.4ETVserver: add the C++ worker factory and the Rust server crate The new server is added beside the C++ one and is not yet part of the `workerd` binary; the next commit switches the binary over and deletes `server.c++`. Here it builds, and the crate's unit tests run. The `workerd-server` crate (`server/`) drives a C++ `WorkerFactory` (`factory/`) through one cxx bridge (`server/bridge.rs`), the one module of the crate that allows `unsafe`. The two depend on each other through that bridge, so they land together. The bridge's async functions that borrow their arguments are declared `async unsafe fn f<'a>`, the form the in-tree cxx requires of a future that is not `'static`. The factory keeps everything that touches the isolate: compiling a worker, starting a request on it, constructing actors with their storage, alarms and containers, the capnp RPC servers, channel-token encoding, the inspector, and the single-tenant policy objects. The server owns the rest: config interpretation, bindings and channel numbering, services, listeners, actor lifecycle and eviction, dynamic workers, drain and the test runner. A worker's bindings cross as one message: the server interprets `Worker.bindings` and `ctx.exports` into `Globals` (`compiled-bindings.capnp`), every capability a channel number, and a new `WorkerdApi::compileGlobals` overload reads that message. The overload taking `WorkerdApi::Global` stays for `server.c++` until the switch. `server/entry.rs` owns the process's schedule: `factory/bootstrap.c++` sets up logging around the command, a `kj_rs_tokio::Runtime` builds the KJ loop with its tokio runtime, the bootstrap sets up perfetto, autogates and V8 on it and builds the factory, and the command blocks on the server as a task on that loop. Sockets are bound and external servers dialed through kj-rs-io's Rust API, and HTTP in both directions is hyper through kj-hyper. Alongside: - `build/wd_rust_crate.bzl` gains `cxx_bridge_visibility`, so that the factory's C++, in another package, can include the server crate's bridge header. - `deps/rust/Cargo.toml` adds `httpdate`, `percent-encoding` and `url` (the disk service), `data-encoding` (CryptoKey bindings), `glob` (test filters) and `ipnet` (`allow` / `deny` ranges). - `clippy.toml` adds `SQLite` and `WebSockets` to `doc-valid-idents`, for the new doc comments. - `json-logger.h` declares `buildJsonLogMessage`, which the server's command-line log lines use. - `:channel-token`, `:v8-platform-impl` and `:workerd_capnp` are visible to the new subpackages. Size, by `wc -l` without the `-test.rs` files: the server crate is 9,779 lines, the factory 3,821 and `compiled-bindings.capnp` 107, together 13,707 against the 9,193 they replace (`server.c++`, `server.h`, `cli-main.{h,c++}`): 1.49x. The crate's unit tests are another 1,412 lines in eight `-test.rs` files. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>Dan Lapid · e697d639 · 2026-10-12
- 6.7ETVkj-hyper: hyper, rustls and kj's WebSockets behind kj-typed seams kj-hyper is the HTTP/1.1, TLS and WebSocket layer for a Rust server whose handlers are kj HTTP interfaces. `server::serve_connection` serves one accepted tokio connection with hyper and dispatches each request to a `Handler` that takes exactly what `kj::HttpService::request` takes (kj headers, a `kj::AsyncInputStream` body, a `kj::HttpService::Response`); CONNECT reaches `Handler::connect` as a `server::Connect` that is answered in Rust or handed to C++ as a `kj::HttpService::ConnectResponse`. `client::Client` implements the kj `Service` trait over hyper-util's pooled legacy client: `Client::new(table, settings, peer, dial)` to one peer through a dialer, asked for paths (`Peer::Origin`) or, of an HTTP proxy, for whole URLs (`Peer::Proxy`), with `tunnel(host)` an HTTP CONNECT through it; `Client::internet(table, settings, tls, connect)` to whatever authority a request's URL names over the caller's `connect(host, port)` (`client::connect_allowed` resolves and connects to the first address a filter admits that accepts), with startTls upgrade through kj's `TlsStarterCallback`. `tls` builds rustls client and server configs from workerd's `TlsOptions` (keypair, trusted certificates, the platform's browser CAs, client-certificate requirement, minimum version). Its cryptography is ring's, except the ECDSA signatures ring cannot verify and BoringSSL can (a P-521 key, or SHA-512 with a P-256 or P-384 key), which the BoringSSL workerd already links verifies (`ecdsa_verify` in kj-hyper.c++), so a chain through a P-521 CA verifies as under kj-http. WebSockets are kj's: kj-hyper does the RFC 6455 handshake and the permessage-deflate agreement (kj's own parser, in kj-hyper.c++) and hands the upgraded transport to `kj::newWebSocket`. A handshake with an unsupported `Sec-WebSocket-Version` is refused with `426` naming version 13 (kj: `400`), and one by POST with `400`. Tokio streams cross to C++ as `kj::AsyncIoStream` (`into_kj_stream`, `into_kj_stream_with`). kj objects that keep a reference into Rust-owned state -- `kj::HttpHeaders` into their header table, a server response or WebSocket into the `WebSocketErrorHandler` in the settings -- cross the bridge as `ffi::Borrowing<'a, T>`, a `KjOwn` bounded by that borrow; the raw bridge functions that build them are `unsafe` and called only from its wrappers. A transport comes with its `Hangup`, a future that resolves when kj's own stream over it would resolve `whenWriteDisconnected()` (a socket hung up or failed, `kj_rs_io::when_write_disconnected`; not a peer that shut down its side; never on Windows, as under kj). `serve_connection` takes it as an argument, and a dialer returns a socket, whose signal `client::Dialed::from` takes, or a `Dialed` made with one. The kj streams made of the connection resolve `whenWriteDisconnected()` from it, and so a `kj::WebSocket` its `whenAborted()`; a stream from plain `into_kj_stream` never does. A socket's signal holds a dup of its descriptor until it is dropped. As kj's `HttpServer` does, `serve_connection` cancels the handler calls of a connection whose transport hangs up (or fails) while it is served; otherwise a call runs to completion, past its response. Messages go out as kj writes them (`body::Head`): the header table's headers first, in the table's order and spelling, then the rest as added, with the connection-level headers, the framing and `Connection: close` set by the protocol at kj's position, so hyper adds none of its own for those. Everything else is hyper's, request parsing included, and differs from kj-http in places: a header's repeated values are written together; a response to HEAD never says `Transfer-Encoding`; a GET or HEAD request body of unknown length is not sent (kj chunks one whose headers say `Transfer-Encoding`); the connection closes after a request that says `Connection: close` (hyper then says so itself, after the other headers) or is HTTP/1.0 without keep-alive; a request with both `Content-Length` and `Transfer-Encoding` is read as chunked and closes the connection; and a request hyper cannot parse never reaches the `Handler` but is answered `400`, `414` or `431` with hyper's description of the error as the body. A call that fails before responding is answered with a bare `500 Internal Server Error` that closes the connection: an exception's text, which kj's default error handler sends, never reaches a client. DISCONNECTED gets no answer, and a failure after the response head went out drops the connection. The prerequisites it needs from the neighbouring crates come along: kj-rs-io's `when_write_disconnected(&socket)` and a public `exception_type` (the type kj gives an I/O error, which `io_kj_error` applies), and in the `kj` crate `ServiceResponse::accept_websocket` with an opaque `kj::WebSocket`, `HeaderTable::builtin()`, and `AsyncInputStream::try_read` / `try_get_length`. The contract tests in kj-hyper/tests are ported from kj's HTTP and TLS tests: a C++ `kj::HttpService` served by kj-hyper and kj-hyper's client behind `kj::newHttpClient`, checked on the wire over loopback TCP and in-process pipes (plain and TLS), driven by a `kj_test` on the tokio-backed `kj::setupAsyncIo()`. They also check header order on the wire, a proxy's whole URLs, and a WebSocket's `whenAborted()` on a reset. TLS policy and unit tests live beside the modules. Nothing in the workerd binary uses the crate yet; workerd's Rust server, in a following change, does. The bridge declarations use the `async unsafe fn f<'a>` form the in-tree cxx requires for borrowed async arguments; they move to the safe form once the bridge supports it. Crate patches (patches/rust/crates/<crate>/, applied through rust.MODULE.bazel): `http` and `httparse` accept the header-value bytes kj accepts (only NUL, CR and LF are rejected), so values round-trip byte for byte; hyper's `HeaderCaseMap` is public so header names keep the application's spelling; hyper's graceful shutdown keeps a connection with a partially received request open until it is answered, as kj's `drain()` does; hyper's client keeps a connection out of the pool until its response body is consumed, as kj's client does; and the response hyper's server generates for a request it cannot parse explains the error in a text/plain body, as kj's server does and RFC 9110 section 15.5 asks. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>Dan Lapid · 5f4f3d3e · 2026-09-26
- 6.0ETVInitial TS streams implJames M Snell · 6d429c9e · 2026-06-25
- 5.1ETVkj-rs-io: KJ async I/O interfaces backed by tokio Final piece of the Rust I/O backend, built on the kj-rs bridge already on main: implements the abstract kj::AsyncIoStream / kj::ConnectionReceiver / kj::Network / kj::AsyncIoProvider / kj::LowLevelAsyncIoProvider interfaces over tokio, so KJ async I/O runs on the tokio-backed kj::EventPort from kj-rs-tokio instead of kj's OS event loop. - Streams, networking (one listening socket per resolved address, KJ's aggregate receiver), socket pairs for the provider's newOneWayPipe/newTwoWayPipe (real sockets, so a write into an empty pipe completes without a reader and workerd's loopback transport gets the sockets it asks for), the --watch file watcher (Rust over the notify crate), signal delivery, and SIGPIPE handling. - Addresses are typed on the bridge. A SocketAddress shared struct (family tag plus that family's fields) is the only form an address takes between Rust and C++: Rust converts it to and from std's SocketAddr / std::os::unix::net::SocketAddr (safe code; the crate views or builds no struct sockaddr bytes at all), and async-io.c++ is the only place a raw sockaddr is decoded (getSockaddr) or encoded (getsockname/getpeername, KJ's NetworkFilter), field by field, at the KJ interfaces that speak them. A caller's struct with garbage past its family's fields, an oversized addrlen, a pathname filling sun_path with no NUL, or a zero-filled sockaddr_un all decode to what KJ makes of them; short or unknown-family structs throw. ffi.rs's hand-written unsafe is fd ownership and the raw read-buffer view alone. - The C++ half is interface adaptation with KJ's own structure where KJ has one. The connect fall-through loop and the accept loop live in the adapter, as in kj/async-io-unix.c++, and apply restrictPeers() there: to each target before connect() tries it and to each accepted peer, through PeerFilter, a wrapper over KJ's own kj::_::NetworkFilter behind a kj::Arc chain (atomic because KJ allows a kj::NetworkAddress to be cloned on another thread and clone() takes a share; a kj::Rc raced under TSAN). Rust returns the peer's typed address with each accepted or connected stream and lists the targets in order; no filter object and no C++ callback crosses the bridge. Both loops own their shares (listener handle, filter), so a receiver or address destroyed with an operation pending does not dangle. KJ's parse-time rejection of a filtered literal (and getSockaddr's eager check) is not reproduced: connect() rejects the same address with the same text. - Two port checks, both two thread-local reads. ensure_loop_thread() before every registration (connect, listen, wrap, resolve, signals, the hangup watch): a call on a thread without a TokioEventPort, or under another runtime entered over the port's, fails with a kj::Exception instead of tokio's "no reactor running" panic (a process abort at the bridge). ensure_owner_loop() -- each stream and listener records the runtime it was registered with -- at the point an operation is about to wait for readiness, never on the fast path: a stream or listener carried to another loop thread fails at its first wait instead of parking on its creator's idle driver forever. Otherwise kj-rs-io is ordinary tokio code: a TokioEventPort thread is a tokio runtime thread for its whole life (kj-rs-tokio), so tokio's own constructors register with the loop's driver as they are; no wrapper runtime type, no lint. - Every adapter method starts its promise inside the call, as KJ's native streams start their operation (coroutine bodies run to their first co_await; eagerlyEvaluate -> EagerPromiseNode -> kj-rs FutureAwaiter::onReady polls on the caller's stack), so a promise that is kept but never awaited completes as the loop turns. When the syscall itself happens is deliberately tokio's semantics, not KJ's: reads and writes are tokio's try_read_buf / try_write / try_write_vectored plus readiness waits, with no direct socket2 / nix / libc syscalls, and vectored writes rely on std clamping the iovec count to IOV_MAX. KJ's AsyncStreamFd issues write(2) synchronously, so a KJ caller may drop a write's promise on the spot and the bytes still go out; under tokio that write is not sent if it is the first operation on a descriptor the driver has not yet seen ready. The long-term direction is to move workerd's I/O onto tokio, so the crate is written as the tokio program it will be part of; workerd's full test suite under the Rust backend has no fire-and-forget write of that kind. - whenWriteDisconnected() costs one dup(2)'d descriptor per stream, created on first use: tokio has one readiness registration per socket, and waiting on it for a hangup would park a concurrent writer. kj-http observes every served connection, so a workerd process holding N connections holds about 2N descriptors under this backend. That is a decision, stated in stream.rs: KJ permits a never-resolving promise (the Windows arm returns one), but early client-disconnect detection is what lets workerd stop work for clients that went away. - Ownership at the FFI boundary: raw fds/SOCKETs become owned typed handles in one `unsafe` block per (unsafe fn) bridge entry point (ffi.rs, the crate's only module allowed to write unsafe), with a bad handle reported as a kj::Exception rather than a panic; KJ read buffers, which callers may leave uninitialized, cross as pointer + length and are handled as MaybeUninit storage rather than `&mut [u8]`. Bridge declarations borrow only where the future really borrows (buffers); operations whose futures own their state are declared safe and lifetime-free, so the compiler enforces that independence. - Operations own their state: every Rust object behind a C++ wrapper is a handle to Arc-shared state and every bridged operation owns a share, so a wrapper destroyed with a read pending does not dangle -- the socket lives until the operation settles or is cancelled (the caller's buffer remains KJ's contract, as under KJ). Every handle is Send + Sync by type (Arc, atomics, Mutex; tokio's own resources are Send + Sync), asserted at compile time in lib.rs, so a rust::Box that C++ carries to another thread is never a memory-safety question. - KJ interface parity for what workerd uses: the address grammar is KJ's SocketAddress::parse for everything workerd.capnp documents for Socket.address / ExternalServer.address -- IP literals, wildcards, decimal ports, service names, hostnames (getaddrinfo with KJ's hints -- AF_UNSPEC, AI_V4MAPPED | AI_ADDRCONFIG -- so IPv6 scope IDs resolve and a host without IPv6 gets no AAAA results; the dns-lookup crate, chosen over tokio::net::lookup_host for exactly those hints and service names), unix: paths and, on Linux, unix-abstract: names (std's from_abstract_name behind tokio's bind_addr / connect_addr); abortRead() ends a pending read with EOF on every platform (the stream records the abort and wakes a parked read itself, since Windows' AFD poller reports no event for a local shutdown(SD_RECEIVE)) and performs KJ's shutdown(SHUT_RD); tryRead waits for readability on EAGAIN whatever minBytes is; address text and watched paths cross the bridge as bytes; connectAuthenticated() and acceptAuthenticated() build the peer identity from the typed peer address, with the network's or receiver's own filter chain threaded into the identity's NetworkAddress as KJ does; accept() retries KJ's set of transient per-connection failures and tolerates TCP_NODELAY failing on an already reset socket; setupTokioAsyncIo() ignores SIGPIPE once per process like kj::UnixEventPort. - Scope: this is workerd's provider, not a drop-in for every KJ program, and lib.rs ("Scope: workerd's provider") says so with the rule behind the list: no consumer in workerd's production code or its configuration surface (workerd.capnp's documented grammar counts), and hand-written libc / sockaddr / fd code to keep. Left out, documented at each site: kj's unix pipe-fd tier (wrapInputFd / wrapOutputFd take sockets only, kj's win32 definition, on every platform; newOneWayPipe is a socket pair), wrapConnectingSocketFd (UNIMPLEMENTED, like getsockopt/setsockopt and newPipeThread), wrapListenSocketFd with a caller-owned NetworkFilter (the two-argument allow-all overload workerd uses works; anything else is UNIMPLEMENTED rather than borrowed for the receiver's lifetime) -- both stubs close a TAKE_OWNERSHIP handle before throwing, since KJ's owning overloads have already released it -- KJ's strtoul(..., 0) port grammar, KJ's std::set re-sort of resolver results (getaddrinfo's RFC 6724 order is kept), the parse-time filter check, and content hashing / ctime tracking in the file watcher (metadata stamps only; the residue -- a same-length rewrite of the same inode within one kernel timestamp tick -- is documented). - The file watcher watches each file's directory (and a symlink target's directory: resolved through dangling links too, so a link whose target is created later fires, re-resolved while the target is missing, and re-registered when a retarget is reported) and judges changes by re-stamping the watched files (inode, size, mtime) whenever the backend reports anything -- an event, an overflow, an error. No event kinds or paths, no content hash, no ctime; a chmod or a replayed pre-watch event moves no stamp and does not fire. No event is stored (the producer only wakes the consumer) and no per-file watch or per-entry descriptor exists. The hand-off from notify's thread is a tokio Notify whose stored permit cannot lose a wake-up; onChange() rejects a second concurrent waiter. It has no C++ wrapper of its own: workerd's TokioFileWatcher (the io_backend change) holds the Rust watcher directly through the three bridged calls. Depends on the kj-rs same-thread waker cells change (#7349, the #7010 subset) for use in workerd: without it, kj-rs's cross-thread waker path races (FuturePollEvent::enterPollScope reading an unfulfilled waker promise, which --config=tsan reports intermittently). This backend must not be enabled by default before that change lands; until then the tokio-backed I/O is opt-in (nothing on main uses it). Dependencies: declares the socket2 (IPV6_V6ONLY, shutdown(2), and the family of a wrapped descriptor), dns-lookup (a safe getaddrinfo wrapper, called with KJ's hints on every platform), notify (file watching, default backends: FSEvents on macOS, which keeps no per-entry descriptor), nix (`fs` for fcntl, `signal` for SIGPIPE) and windows-sys (the Win32 / winsock error codes of KJ's exception-type table) crates and enables tokio's signal and io-util (try_read_buf into uninitialized buffers) features; Cargo.lock repinned accordingly. The CoreServices framework is linked on macOS for FSEvents. Tests: tokio-backed streams and networks (including SIGPIPE survival in a child process with the default disposition, a multi-address hostname listener accepting on every family, vectored writes past IOV_MAX worth of empty pieces and of non-empty pieces, unawaited (kept) writes still going out, abortRead ending a pending read, AF_UNIX pathname and -- on Linux -- abstract sockets listening, connecting, printing and identifying, socket-pair provider semantics (the Windows loopback pair accepting only its own client), decimal ports and service names with the octal/hex grammar gone, the intentional UNIMPLEMENTED / sockets-only stubs), file watching (including a symlinked file whose target lives elsewhere, a retargeted symlink whose new target directory is watched from then on, and a symlink whose target does not exist yet), connectAuthenticated identities over TCP and unix sockets (with the network's filter kept), sockaddrs with garbage past the family's fields or in their padding decoding to the same address, a sun_path-filling unterminated pathname printed whole, short or unknown-family sockaddrs rejected, restrictPeers applied at connect() and accept() (not at parse), every bridged operation refused with a kj::Exception on a thread without a TokioEventPort or under a foreign entered runtime (accept() included), reads and accepts on a different port refused at their first wait, transferred handles closed by the UNIMPLEMENTED stubs, addresses cloned concurrently on two threads (TSAN-clean, kj::Arc), HTTP over tokio-backed streams, a zero-initialized sockaddr_un through getSockaddr, an address with no socket addresses failing connect() and listen(), a zero-minimum read waiting for data, a cancelled backpressured write leaving the socket usable, Cap'n Proto RPC over tokio streams, and PeerFilter's chain ownership and atomic sharing. The C++ tests link statically on every platform: Bazel links cc_test binaries dynamically by default, and under the Linux tsan config each shared library then carries its own unwinder, so an exception thrown in libkj-rs-io-lib.so that unwinds through a frame in libkj-async-io.so (kj's inline owning wrap*Fd overloads) aborted in _Unwind_SetGR. Clean under --config=asan, --config=tsan-macos and the Linux tsan lane. Co-Authored-By: Harris Hancock <harris@cloudflare.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>Dan Lapid · 216ed990 · 2026-09-12
- 4.9ETVrust: move inline unit tests into <module>-test.rs files Applies the convention introduced in the previous commit to every production crate, so that from here on a diff to a Rust source file is a diff to production code. This is a mechanical move and does not need line-by-line review. A script lifted the body of each inline test module into the sibling test file, and rustfmt re-indented it. No test was added, removed or edited, and no production code changed. Instead of reading the diff, a reviewer can rely on what was checked: - each test file holds exactly as many #[test] functions as the inline module it came from, and each crate's test target runs and passes them; - the string literals in the moved tests are identical before and after re-indentation; - clippy and rustfmt are clean on the crates and on their tests. The one thing that is not a pure move: the test module is uniformly named `tests` and declared at the end of its file, which renames the two modules that were called something else. Crates that are test code throughout are left as they are. They have no production code to separate the tests from. Co-Authored-By: Claude Code <noreply@anthropic.com>Dan Lapid · f8f82edc · 2026-10-05
- 4.2ETVadd node:fs and node:fs/promises stub methods (#3796)Yagiz Nizipli · 24d5823c · 2025-06-02
- 3.7ETVAdd TS/C++ streams benchmarksJames M Snell · 8941f0fd · 2026-10-23
- 3.7ETVadd gc support to Rust owned objectsYagiz Nizipli · 75b49f9e · 2026-03-18
- 3.3ETVAdd async-trace Rust crate for async activity tracking First step of the async trace core: a standalone crate with no callers yet. It holds the stateful half of the design, which is unit-testable without V8: - IsolateState: per-isolate resource ID allocation and stack deduplication. - Tracker: one per IoContext. Tracks the execution scope stack, turns and their causes (the default trigger for resources created during a turn, which attributes work after `await` without promise hooks), live resources, and the adoption of a binding operation by the awaitIo bridge that resumes it. Caller mistakes are counted in ContextStats rather than panicking. - Sink trait with an NDJSON sink (format v1, one shared writer per process, per-tracker buffering so lines never interleave) and a recording sink for tests. - A cxx bridge exposing opaque Isolate, Tracker and Writer types. Kinds and outcomes cross as u8. No JavaScript-visible API change.James M Snell · e6c624b0 · 2026-10-08