Overview of workerd for Windows 64-bit
mainworkerd is a JavaScript / Wasm server runtime based on the same code that powers Cloudflare Workers. This specific package provides the Windows 64-bit build of the runtime.repository·main·Indexed 27 days ago
https://github.com/cloudflare/workerdCloudflare's JavaScript and WebAssembly (Wasm) server runtime, the same engine that powers Cloudflare Workers. Designed for high-performance application hosting, local development, and programmable HTTP proxying, workerd allows developers to run worker-like code in local or custom server environments. It features configuration via Cap'n Proto and supports builds for Linux, macOS, and Windows.
workerd is a JavaScript / Wasm server runtime based on the same code that powers Cloudflare Workers. This specific package provides the Windows 64-bit build of the runtime.workerd is a JavaScript and WebAssembly (Wasm) server runtime. It is based on the same core technology that powers the Cloudflare Workers platform.workerd is a JavaScript / Wasm server runtime based on the same code that powers Cloudflare Workers. This specific package is the build of the runtime for Linux ARM 64-bit architectures.workerd is a JavaScript and WebAssembly (Wasm) server runtime. It is based on the same core engine that powers Cloudflare Workers, allowing developers to run worker-like code in a local or custom server environment.
For general details, implementation information, and the main repository, visit https://github.com/cloudflare/workerd.
The workerd source tree is organized into several functional subdirectories that define the runtime's capabilities:
workerd is a JavaScript and WebAssembly (Wasm) server runtime. It is based on the same core engine that powers Cloudflare Workers, providing a high-performance environment for executing server-side JavaScript and Wasm code.The new jsg::modules::ModuleRegistry implementation uses a two-layer architecture to support thread-safe module sharing across multiple isolate replicas:
Owned by Worker::Script, this layer is thread-safe and shared across all replicas of a worker. It contains:
ModuleRegistry: The central registry (using kj::AtomicRefcounted).ModuleBundle: Abstractions for composing registries from different sources (worker bundle, builtins, internal-only, and fallback).Module: Isolate-independent definitions of modules.Owned by JsContext and destroyed with the context. It contains:
IsolateModuleRegistry: Holds the per-isolate V8 handles and maintains a back-reference to the shared ModuleRegistry.lookupCache: A triple-indexed kj::Table used for O(1) lookups by V8 module identity, (type, URL) pairs, or URL alone.The new module registry in workerd is designed for high performance and efficiency through several key characteristics:
ada-url.EvaluateCallback functions can be called multiple times from different isolates, creating fresh JS objects each time.Evaluate, microtasks are drained. If the returned Promise is still pending, a "top-level await" error is thrown. Workers must initialize synchronously.The Wrappable base class manages the connection between C++ objects and their JavaScript wrappers.
Key behaviors:
kj::Refcounted (for the JS wrapper) and a second "strong ref" count for jsg::Ref<T> pointers.detachWrapper() is called, leaving the JS wrapper as an empty shell. If a wrapper is collected by GC but the C++ object is still alive, a new wrapper is created on the next JS access.To check if an object is a workerd API object, use jsg::Wrappable::isWorkerdApiObject(object).
The ReadableStream.tee() method splits a stream into two branches. While the WHATWG spec suggests that one branch reading faster than another causes unbounded memory growth due to data copying, workerd implements an optimized version:
kj::Rc<Entry>) to shared data instead of making physical copies.This implementation helps prevent memory pileup, provided the underlying source respects backpressure signals.
Node.js compatibility in workerd is a best-effort implementation. It is not intended to be 100% compatible with Node.js. Developers should be aware of the following behaviors:
nodejs_compat flag makes Node.js APIs available, but it does not guarantee that all APIs behave exactly as they do in Node.js.The workerd runtime exposes two distinct implementations of the Streams API through the same ReadableStream, WritableStream, and TransformStream JavaScript interfaces. Understanding which one you are using is critical for performance and behavior:
Internal Streams:
request.body or response.body.kj asynchronous I/O primitives.TypedArray and ArrayBuffer).read() twice without awaiting the first will result in an error.pull algorithm.Standard Streams:
new ReadableStream(...) with user-provided callbacks or via new TransformStream() (subject to compatibility flags).pull algorithm and maintain internal queues for data and pending reads.