Skip to content
Nilay Kabariya

Entry No.012·Tested··3 min read

Bun vs Node.js 24 benchmark: startup, TypeScript and tests

The same code run on Bun 1.4 and Node 24 on an ordinary laptop: startup, running TypeScript directly, CPU work and a test suite. One result went Node's way.

by Nilay#bun#nodejs#typescript#performanceTESTED

Verdict

Bun started 1.7× faster, ran a TypeScript file 3× faster and finished the same test suite 5× faster. Node won the tight number-crunching loop. The HTTP test hit a limit of this machine, not of either runtime.

Tested on

Node
24.14.0
Bun
1.4.2
Machine
i3-1115G4, 2 cores, 12 GB, NVMe SSD
OS
Windows 11 Pro 26200
Contents
  1. The results01
  2. What that means in practice02
  3. The HTTP test didn’t count, and why03
  4. How this was measured04
  5. Limits of this test05

Same machine, same files, and wherever possible the exact same code on both runtimes. Every number below is a median of repeated runs, and both runtimes had to produce the identical result (checksum 864579) for the CPU test to count.

The results

Startup: run an empty scriptlower is better · ms
  1. Bun34.5 msbest
  2. Node58.7 ms
Run a TypeScript file directly (no build step)lower is better · ms
  1. Bun36.8 msbest
  2. Node114.0 ms
Test runner: the same 300 node:test testslower is better · ms
  1. Bun76 msbest
  2. Node381 ms
CPU: sort 2 million numberslower is better · ms
  1. Bun578 msbest
  2. Node1372 ms
CPU: JSON round-trip of 200,000 objectslower is better · ms
  1. Bun245 msbest
  2. Node331 ms
CPU: prime sieve up to 10 millionlower is better · ms
  1. Node113 msbest
  2. Bun125 ms

What that means in practice

  • Scripts, CLIs and dev tooling feel faster on Bun. It starts about 1.7× faster. For anything you run many times a day (scripts, git hooks, one-off tools), that adds up.
  • Running TypeScript without a build: both can now do it, but Bun was about 3× faster here (37 ms vs 114 ms). Node 24 strips types natively, which is convenient, but it doesn’t match Bun’s startup.
  • Tests: bun test ran the same 300 node:test tests about 5× faster than node --test, partly because node --test runs each test file in its own child process, so even this single file paid for a second Node startup.
  • Raw computation is closer than the headlines suggest. Bun sorted about 2.4× faster and did JSON about 1.35× faster, but Node won the tight loop (the prime sieve) by about 10%. If your app is mostly number-crunching, don’t switch for speed alone.
  • Node is still the safe default for compatibility: every npm package and tool is built for it first. Bun is worth it where its speed shows up directly: scripts, tests and TypeScript tooling.

The HTTP test didn’t count, and why

I also load-tested an identical node:http server on both runtimes, plus Bun’s own Bun.serve. All three landed at about 600–700 requests per second, suspiciously equal and far too low for a “hello world” server.

To compare HTTP throughput, run it on Linux or on separate client and server machines.

How this was measured

  • Same code on both runtimes: the CPU test, the TypeScript file and the 300 tests were byte-for-byte identical. The test file uses node:test and node:assert, which Bun supports.
  • Repeated runs, median reported: startup 30 runs, TypeScript 20, CPU 5 (timed inside the process), tests 7.
  • Startup and TypeScript timings include creating the process, measured from Node’s spawnSync. That’s the time you actually wait when you run a command.
  • The CPU tasks had to agree: both runtimes produced the same checksum, so neither was skipping work.

Limits of this test

  • One Windows laptop with 2 cores. Results on Linux, macOS or a big server can differ, especially for the test runner and HTTP.
  • Micro-benchmarks, not your app. Real apps spend time on I/O, databases and dependencies. Measure your own workload before switching.
  • Bun’s compatibility wasn’t tested here, only speed. Some Node packages and APIs still behave differently on Bun.

— N.K., end of entry No.012

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.011

    npm vs pnpm vs Yarn vs Bun: install speed benchmark (2026)

    pnpm is the best all-rounder: 2.8× faster than npm from a cold start and near-instant when nothing changed. Bun wins with a warm cache. Yarn 1 was the slowest and needed a 3.7 GB cache.

    TESTED4 min
  2. No.053

    Bun "error: Cannot find module": every cause, tested

    Bun prints the same Cannot find module error for six different problems. Each one reproduced on Bun 1.4.2 on Windows and Linux, with the fix that worked.

    > error: Cannot find module '@mono/ui' from 'D:\nk-repro\bun-cnf\e-mono\apps\web\index.ts'

    FIXED8 min
  3. No.044

    SvelteKit 3 migration, tested: what sv migrate misses

    sv migrate sveltekit-3 upgraded every package and moved the config correctly, but left three removed options in place, so the first build failed three times in a row. Worse, it rewrote a working {base}/about link into one that 404s, and that passed both the build and svelte-check.

    TESTED4 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text