Performance

Benchmarks

A measured comparison: the same JavaScript handlers on DataVec and, priced from its published rates, on Cloudflare Workers. Below are the results, exactly how they were taken, and what they can't tell you yet. More workloads and platforms follow.

Results

Cost per million requests: DataVec vs Cloudflare Workers

WorkloadDataVec req/sp50 / p99 msDataVec $/MCloudflare CPU msCloudflare $/M
Light compute
1 round of JSON parse, filter, sort, stringify
6,698
on 1 × 1 vCPU VM
1.6 / 9.2$0.00100.198$0.30
Medium compute
10 rounds
4,067
on 1 × 1 vCPU VM
1.2 / 6.7$0.00160.914$0.32
Heavy compute
100 rounds
812
on 1 × 1 vCPU VM
11.5 / 39.1$0.00817.78$0.46
SQL read
one row by primary key
4,819
on 4 × 1 vCPU VMs
4 / 12.5$0.00540.105$0.30
SQL write
one row, committed on 2 of 3 log nodes (fsync)
358
on 4 × 1 vCPU VMs
10.3 / 39.9$0.07330.098$1.30
  • DataVec: measured over HTTPS against a live service on 1 vCPU / 1 GB VMs, from a load generator in the same region, at the highest load that kept p99 under 50 ms with no errors. Cost is the $17/month catalog price per VM divided by that throughput, so it assumes the VMs are kept busy. The SQL rows use the store's whole service: the VM that runs it and its three log nodes.
  • Cloudflare: not run on Cloudflare. The same handler source ran in workerd, Cloudflare's open-source Workers runtime, to measure CPU time per request, priced at Workers Paid overage rates ($0.30 per million requests plus $0.02 per million CPU-ms) plus D1's per-row prices. workerd's own HTTP handling (about 0.1 ms) is included, which slightly overstates Cloudflare's cost.
  • Writesare durable before the reply: each one is on two of three log nodes, fsync'd. Group commit batches the commits waiting at the same moment into one round to the log nodes, so concurrent writers share each round.
  • Connections are reused in these runs (keep-alive), as browsers and API clients usually do. With a new TLS connection for every request (session resumed), one VM served about 957 light requests per second at p99 31 ms: the handshake costs about 0.9 ms of CPU. Cloudflare terminates TLS without billing it as Worker CPU.
  • Low traffic favors per-request billing. Cloudflare scales to zero and includes 10 million requests a month; a VM costs the same idle or busy. At a steady few requests per second, a metered platform is usually cheaper. The calculator above sizes a VM for your traffic.

Connection-oriented, not request-oriented

On DataVec, work lives on the connection: the TLS handshake is paid once and amortized over every request, the database session is pooled and reused across queries, and the compiled handler is always resident. A request-per-isolate runtime re-establishes that state per invocation — and a worker that can't carry a socket forward must reconnect to its database or rent a managed pooling tier. Connection-oriented execution is the root of the throughput and latency difference.

Compiled C, always resident

DataVec translates your handler to native C and runs it as a resident coroutine loop — ahead-of-time compiled (no JIT warm-up), no interpreter, no garbage-collection pauses, and no per-invocation isolate to spin up. Because you pay for a running service rather than per request, there is no economic pressure to evict idle handlers, so they never cold-start.

Next workloads

The same handler on every platform

  • Static routing — pure dispatch + framing on a tiny response.
  • JSON transform — parse a body, sum an array, serialize the result.
  • JWT verify — verify one token per request, both RS256 (RSA-2048) and HS256 (HMAC-SHA-256).
  • SSE token streaming — a chunked text/event-stream response (the AI-gateway shape, minus the model).
  • Static asset — serve a cached body at small and large sizes.

How we measured

The methodology page states the setup behind every figure above: the VMs, the load generator, how each load step was run and judged, what each workload does, how Cloudflare's cost was estimated, and the limits of what these comparisons can tell you.

Deploy JavaScript that compiles to native C

Standard Web Workers, Next.js static builds, and Elysia APIs with predictable pricing starting at $17/month.