For over a decade, Node.js and Express have been the default foundation for server-side JavaScript and TypeScript web APIs. However, modern workloads—real-time event streaming, high-frequency IoT ingestion, and high-concurrency microservices—often hit performance bottlenecks caused by Node's V8 JIT startup times, non-trivial memory baselines, and legacy HTTP parser overhead.

The emergence of Bun (written in Zig and powered by Apple's JavaScriptCore engine) and ElysiaJS (an ergonomic, end-to-end type-safe web framework built natively for Bun) offers a compelling alternative.

Here are the results of our real-world, high-concurrency benchmark testing.


The Test Environment & Methodology

Benchmarks were conducted on an isolated bare-metal node to eliminate cloud hypervisor CPU-stealing and noisy-neighbor interference:

  • Hardware: AMD Ryzen 9 7950X (16 Cores, 32 Threads), 64GB DDR5-5600 ECC RAM, Dual 10Gbps Mellanox SFP+ NICs.
  • OS: Ubuntu 24.04 LTS (Linux 6.8 kernel, sysctl tuned for high socket reuse: tcp_tw_reuse=1, somaxconn=65535).
  • Load Generator: wrk running on a separate dedicated node over direct 10GbE DAC cabling.
  • Test Duration: 60-second stress runs across varying concurrency levels (100, 500, 1,000, and 5,000 concurrent keep-alive connections).
  • The Target API Endpoints

    Each framework implemented an identical business logic endpoint:

  • Parse an incoming JSON payload with a schema validator (Zod for Express, TypeBox for Elysia).
  • Query a local PostgreSQL connection pool for an authenticated customer record.
  • Compute an HMAC-SHA256 signature token.
  • Return a structured JSON response with metadata headers.

  • Benchmark Results & Performance Deltas

    1. Throughput (Requests Per Second — Higher is Better)

    Concurrency LevelNode.js 22 + Express 4.xBun 1.1 + Elysia 1.0Throughput Delta
    100 Connections18,420 req/sec74,180 req/sec+302% (4.0x)
    500 Connections21,150 req/sec118,400 req/sec+459% (5.5x)
    1,000 Connections19,800 req/sec126,850 req/sec+540% (6.4x)
    5,000 Connections16,300 req/sec112,400 req/sec+589% (6.8x)

    2. Latency Distribution at 1,000 Concurrent Connections

  • Node.js + Express:
  • Average Latency: 50.4 ms
  • 99th Percentile (p99): 142.8 ms
  • Max Latency: 384.2 ms
  • Bun + Elysia:
  • Average Latency: 7.8 ms
  • 99th Percentile (p99): 18.2 ms
  • Max Latency: 41.6 ms
  • 3. Cold Start & Idle Memory Footprint

  • Node.js + Express: 54 MB RSS at idle; ~120 ms process start.
  • Bun + Elysia: 18 MB RSS at idle; ~14 ms process start.

  • Why is Bun + Elysia So Much Faster?

    The performance gains come from three specific architectural differences:

  • Native Static Code Analysis & Route JIT: Elysia compiles route handlers into optimized, monolithic JavaScript functions on application boot. Instead of evaluating middleware arrays on every incoming request like Express, Elysia inlines validation and response headers into a single call path.
  • TypeBox vs. Zod Validation: Elysia utilizes TypeBox, which compiles TypeScript schemas directly into pure JavaScript validation functions that execute up to 20x faster than Zod's runtime traversal.
  • JavaScriptCore vs. Google V8: JavaScriptCore handles short-lived objects and rapid allocations with lower garbage collection latency spikes than V8, leading to much tighter p99 latency distributions under load.

  • Code Comparison: Clean Type Safety

    Beyond raw performance, Elysia provides compile-time and runtime type inference with zero code duplication:

    typescript
    import { Elysia, t } from 'elysia'
    
    export const app = new Elysia()
      .post('/api/checkout', async ({ body }) => {
        // body is strongly typed at compile time and validated at runtime
        return {
          status: 'confirmed',
          orderId: crypto.randomUUID(),
          total: body.quantity * body.unitPrice,
        }
      }, {
        body: t.Object({
          sku: t.String(),
          quantity: t.Number({ minimum: 1 }),
          unitPrice: t.Number(),
        })
      })
      .listen(3000)

    For teams building new high-throughput microservices or high-velocity event APIs, Bun and Elysia deliver substantial infrastructure cost savings and superior user-facing response times.