CONCEPT Cited by 1 source
Runtime choice per workload¶
Runtime choice per workload is the design stance that the JavaScript runtime a function runs on is a per-workload decision, not a platform-wide commitment. Each runtime exposes different trade-offs on a small number of explicit axes, and the right choice depends on the workload's dominant cost.
The four axes (per 2026-04-21 Vercel disclosure)¶
Vercel's Bun + Node.js comparison canonicalises four explicit trade-off dimensions:
| Axis | What varies | Who wins when |
|---|---|---|
| Performance (CPU-bound + streaming) | Runtime's JIT + I/O scheduler + streams implementation | Bun for CPU-heavy SSR |
| Cold starts | Runtime initialisation overhead | Node.js (mature) |
| Compatibility | Node.js API coverage (or proprietary runtime API) | Node.js (native); Bun partial |
| Ecosystem maturity | Library count, community, stability | Node.js (decade-plus, OpenJS) |
Plus implicit fifth axis: billing model alignment. Active CPU pricing compresses the performance axis directly into cost, inverting part of the trade-off for CPU-bound workloads.
Canonical decision framing¶
Each runtime has distinct strengths. Bun delivers clear speed improvements for server rendering workloads, while Node.js remains the most compatible and battle-tested environment. ... Test your dependencies under Bun before migrating production traffic to confirm expected behavior. While Bun implements Node.js APIs, some edge cases may behave differently.
(Source: sources/2026-04-21-vercel-bun-runtime-on-vercel-functions)
Rules of thumb¶
- CPU-bound / streaming SSR → faster runtime (Bun, per 2026-04-21 Vercel data: 28 % TTLB win on Next.js SSR). The win concentrates in Web Streams transform cost.
- Cold-start-sensitive + sporadic traffic → mature runtime (Node.js) — faster warm-up.
- Long-tail Node-specific library dependency → Node.js — edge-case API differences under newer runtimes are real.
- Production stability requirement without performance target → Node.js default.
Structural requirement on the platform¶
Runtime choice per workload is only possible if the hosting platform ships multiple runtimes natively without emulation — see patterns/multi-runtime-function-platform. Emulation + compatibility-shim approaches preserve workload portability at the cost of the per-workload performance axis (emulation tax eats the runtime's advantage).
Platform-level inversion¶
Historically, one function platform = one runtime (AWS Lambda → Node; Cloudflare Workers → V8 isolate; AWS Lambda with a custom runtime was the rare escape hatch). The 2026-04-21 Vercel Functions launch of Bun alongside Node.js, switchable per project, inverts this — the platform's opinion about runtime is "pick per workload" rather than "we picked for you."
Economic compression (Active CPU)¶
Under wall-clock billing (classical Lambda GB-seconds), a faster runtime only translates to cost savings if it also unlocks more concurrent throughput per instance. Under Active CPU pricing, a 28 % latency reduction on CPU-bound workloads yields ~28 % direct billing reduction — the runtime-choice decision has measurable dollar consequence, not just throughput consequence.
Caveat¶
Runtime choice can't fix poor application architecture. A workload dominated by downstream API calls or database I/O won't see the CPU-bound performance axis; all runtimes spend the time waiting. The runtime-choice lever matters precisely where on-CPU JavaScript + framework code dominates the critical path.
Seen in¶
- sources/2026-04-21-vercel-bun-runtime-on-vercel-functions — canonical wiki introduction. Four-axis trade-off table disclosed verbatim; test-dependencies-first caveat; billing- alignment via Active CPU.
Related¶
- systems/bun — the performance-axis option.
- systems/nodejs — the compatibility + ecosystem-axis option.
- systems/vercel-functions — the platform operationalising
per-workload runtime choice via
bunVersion. - patterns/multi-runtime-function-platform — the platform-design pattern runtime choice requires.
- patterns/workload-aware-runtime-selection — the customer-side pattern that operationalises the choice.