Updates

Cloudflare Expands Rust Support for Workers With New Crate, Performance Gains

Cloudflare's new `worker` crate lets Rustaceans write Workers entirely in Rust, while a Rust-rewritten FL2 stack on Gen 13 AMD EPYC Turin hardware doubles compute throughput.

Nina Kowalski3 min read
Published
Listen to this article0:00 min
Share this article:
Cloudflare Expands Rust Support for Workers With New Crate, Performance Gains
Source: blog.cloudflare.com
This article contains affiliate links, marked with a blue dot. We may earn a small commission at no extra cost to you.

Twice the compute throughput, a new first-class crate on crates.io, and agent error payloads shrunk by 98%: Cloudflare stacked a remarkable amount of Rust-forward news into a single week in late March 2026.

The centerpiece for the Rust community is the `worker` crate, available on GitHub and crates.io, which gives developers a native path to run Rust code inside the V8 WebAssembly engine on the Workers platform. The accompanying workers-rs repository, whose README carries the unambiguous tagline "Work-in-progress ergonomic Rust bindings to Cloudflare Workers environment. Write your entire worker in Rust!", provides the scaffolding that makes the workflow practical. The worker crate does all the heavy lifting by providing Rustacean-friendly Workers APIs.

Getting started is deliberately low-friction. Cloudflare Workers now provides support for Rust via the workers-rs crate, which makes Runtime APIs and bindings to developer platform products such as Workers KV, R2, and Queues available directly from Rust code. The official docs, last updated March 20, 2026, walk through a prerequisite list that includes adding the `wasm32-unknown-unknown` target with `rustup target add wasm32-unknown-unknown`, installing `cargo-generate` with `cargo install cargo-generate`, and bootstrapping a project with `cargo generate cloudflare/workers-rs`. The generated project lands in a directory containing `Cargo.toml`, `wrangler.toml`, `worker-build`, and `src` — everything needed to start writing idiomatic Rust immediately.

Binary size is a real concern when targeting WebAssembly, and the template addresses it directly. Unoptimized Rust Wasm binaries can be large and may exceed Worker bundle size limits or experience long startup times; the template project pre-configures several useful size optimizations in the `Cargo.toml` file — `lto = true`, `strip = true`, and `codegen-units = 1` under `[profile.release]`. From there, `worker-bundle` automatically invokes `wasm-opt` to further reduce binary size before upload. For cross-Worker communication, creating types and bindings for invoking another Worker's RPC methods is more involved, requiring complex `wasm-bindgen` bindings and some boilerplate, with `serde-wasm-bindgen` available to support non-primitive argument and return types.

The infrastructure story running underneath all of this is equally Rust-centric. Cloudflare's Gen 13 servers double compute throughput by rethinking the balance between cache and cores; moving to high-core-count AMD EPYC Turin CPUs traded large L3 cache for raw compute density, and running the new Rust-based FL2 stack completely mitigated the latency penalty to unlock twice the performance. FL2, a Rust-based rewrite of Cloudflare's core request handling layer, allowed the company to prove Gen 13's full potential; it removes the dependency on larger cache, allowing performance to scale linearly with core count. Gen 13 is designed around the 192-core AMD EPYC Turin 9965 processor, paired with 768 GB of DDR5-6400 memory, 24 TB of PCIe 5.0 NVMe storage, and a dual 100 GbE network interface card.

AI-generated illustration
AI-generated illustration

Compared to the Gen 12 Genoa-X servers, Cloudflare measured 2x throughput with the EPYC 9965-based Gen 13 machines, 50% better performance-per-watt, and up to 60% higher rack throughput. Hardware qualification is complete, and Gen 13 servers are now shipping at scale to support the global rollout.

On the AI side of the platform, Kimi K2.5 is now on Workers AI, helping power agents entirely on Cloudflare's Developer Platform. The platform also changed how it communicates errors to those agents: Cloudflare now returns RFC 9457-compliant structured Markdown and JSON error payloads in place of heavyweight HTML pages, a shift the company says reduces token usage by over 98% and turns brittle parsing into efficient control flow.

For Rustaceans who have watched Workers support feel like a second-class citizen compared to JavaScript, the combination of a well-maintained crate, first-party documentation, and infrastructure rebuilt in Rust from the ground up signals that the gap has closed considerably.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.
Get Rust Programming updates weekly.

The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News