What happened

Convex in Prod has released convex-wasm-compiler, which compiles Convex queries and mutations into Wasm.

The companion change on the backend runs these compiled functions using Wasmtime fibers within the existing Tokio runtime. Initial testing suggests a 2x average speedup for queries, with a tail reduction of 3x and a memory footprint drop of 80% compared to relying on V8 context caching.

Why it matters

Scaling Convex applications—particularly self-hosted ones—has been a persistent challenge. The ability to dramatically reduce query latency and memory consumption offers tangible benefits for performance-sensitive workloads, notably those supporting high concurrency or large datasets. Reducing the memory footprint of runtime contexts also makes it possible to host Convex on smaller servers.

But, but, but…

This work rests on the assumption that V8 context reuse is a reasonable approach—a move which itself hinges on what constitutes ‘warm-up’ – and on the stability of the Tokio runtime.

The reliance on Wasmtime fibers introduces a dependency on another ecosystem, one that may or may not mature as quickly as Convex itself. It's also worth acknowledging that this experiment is at an early stage: further benchmarking under heavier production loads would be needed to fully validate these results before betting the farm on it.

““I have developed convex-wasm-compiler that compiles Convex queries and mutations into WebAssembly and the accompanying change to convex-backend to execute Wasm-compiled Convex functions using Wasmtime fibers right on convex-backend’s Tokio runtime.””
— Dr Non

The counter-take

The most interesting version isn’t about achieving raw speed—it’s about questioning the implicit assumptions underpinning current Convex development practices, particularly around context reuse and runtime optimization.

The AI angle

The upgrade represents a significant asymmetry in performance—leveraging Wasm optimizes the execution of Convex queries and mutations, amplifying developer velocity and reducing operational costs associated with scaling high-demand applications. This creates a new landscape for deploying serverless Convex workloads without the complexity of managing large V8 context caches.