Vercel Announces Edge Functions v2 with Rust Support
What happened
Vercel has announced the release of Edge Functions v2, featuring native support for the Rust programming language. The company claims the update enables up to 10 times faster cold starts and enhanced security due to Rust's memory safety features. In a coordinated release, the Next.js team published an update with new tooling to simplify the integration of the new Rust-based functions into Next.js applications.
Why it matters
- Vercel's move toward Rust isn't new; the company previously rebuilt parts of its standard function infrastructure from Node.js to Rust, which cut cold starts by 30% for smaller workloads and made larger ones up to 500ms faster at the 99th percentile. - Prior to native support, developers could run Rust on Vercel's edge by compiling it to WebAssembly (Wasm), a format supported since August 2022. Vercel's own tests showed that for computationally heavy tasks, Wasm could be more than twice as fast as equivalent JavaScript code. - The Next.js framework has been increasingly leveraging Rust for performance gains. Its compiler, SWC, is written in Rust and is up to 17 times faster than its predecessor, Babel, for JavaScript transpilation. - Edge Functions run on a lightweight V8 isolates runtime, which is different from a full Node.js environment and lacks features like direct file system access but enables faster startups. This contrasts with Vercel's standard Serverless Functions, which can run a full Node.js runtime. - A key competitor, Cloudflare Workers, also utilizes V8 isolates and has long supported Rust via WebAssembly, often cited for achieving near-instantaneous cold starts of less than 1 millisecond. Existing Vercel Edge Functions typically have cold starts under 50ms, a significant improvement over traditional serverless offerings. - The new tooling will likely integrate with Vercel's existing beta support for native Rust serverless functions, which uses a `Cargo.toml` file for configuration and places handler files in a root `/api` directory. - This update focuses on the "cold start" problem—the delay when a function is invoked for the first time after being idle. While Vercel's Edge Functions are already much faster than traditional serverless platforms, this aims to make them competitive with the near-zero cold starts of rivals.
Key numbers
- Vercel has announced the release of Edge Functions v2, featuring native support for the Rust programming language.
- The company claims the update enables up to 10 times faster cold starts and enhanced security due to Rust's memory safety features.
- - Vercel's move toward Rust isn't new; the company previously rebuilt parts of its standard function infrastructure from Node.js to Rust, which cut cold starts by 30% for smaller workloads and made larger ones up to 500ms faster at the 99th percentile.
- Prior to native support, developers could run Rust on Vercel's edge by compiling it to WebAssembly (Wasm), a format supported since August 2022.
What happens next
- Prior to native support, developers could run Rust on Vercel's edge by compiling it to WebAssembly (Wasm), a format supported since August 2022.
- Vercel's own tests showed that for computationally heavy tasks, Wasm could be more than twice as fast as equivalent JavaScript code.
- The Next.js framework has been increasingly leveraging Rust for performance gains.
Quick answers
What happened in Vercel Announces Edge Functions v2 with Rust Support?
Vercel has announced the release of Edge Functions v2, featuring native support for the Rust programming language. The company claims the update enables up to 10 times faster cold starts and enhanced security due to Rust's memory safety features. In a coordinated release, the Next.js team published an update with new tooling to simplify the integration of the new Rust-based functions into Next.js applications.
Why does Vercel Announces Edge Functions v2 with Rust Support matter?
Vercel's move toward Rust isn't new; the company previously rebuilt parts of its standard function infrastructure from Node.js to Rust, which cut cold starts by 30% for smaller workloads and made larger ones up to 500ms faster at the 99th percentile. Prior to native support, developers could run Rust on Vercel's edge by compiling it to WebAssembly (Wasm), a format supported since August 2022. Vercel's own tests showed that for computationally heavy tasks, Wasm could be more than twice as fast as equivalent JavaScript code. The Next.js framework has been increasingly leveraging Rust for performance gains. Its compiler, SWC, is written in Rust and is up to 17 times faster than its predecessor, Babel, for JavaScript transpilation. Edge Functions run on a lightweight V8 isolates runtime, which is different from a full Node.js environment and lacks features like direct file system access but enables faster startups. This contrasts with Vercel's standard Serverless Functions, which can run a full Node.js runtime. A key competitor, Cloudflare Workers, also utilizes V8 isolates and has long supported Rust via WebAssembly, often cited for achieving near-instantaneous cold starts of less than 1 millisecond. Existing Vercel Edge Functions typically have cold starts under 50ms, a significant improvement over traditional serverless offerings. The new tooling will likely integrate with Vercel's existing beta support for native Rust serverless functions, which uses a Cargo.toml file for configuration and places handler files in a root /api directory. This update focuses on the "cold start" problem—the delay when a function is invoked for the first time after being idle. While Vercel's Edge Functions are already much faster than traditional serverless platforms, this aims to make them competitive with the near-zero cold starts of rivals.