Benchmarks two or more Node.js binaries against each other across startup time, memory usage, JSON, buffers, streams, zlib, URL parsing, and more. Binary names are derived from their filenames and used as labels throughout all output — no hardcoded assumptions about what you're comparing. Works on Windows and Linux.
| Script | Purpose |
|---|---|
index.js |
Entry point. Routes to pairwise or multi-binary comparison automatically. |
benchmarks/benchmark_compare.js |
Pairwise benchmark — exactly 2 binaries. Includes a Diff % column. |
benchmarks/benchmark_compare_multiple.js |
2+ binaries. For 2 binaries, delegates to pairwise. For 3+, runs a multi-column table. |
benchmarks/benchmark_single.js |
single binary for capturing a baseline. |
node index.js <binary>Optional flags (single-binary mode only):
| Flag | Description |
|---|---|
--benchmark <name> |
Run only the named benchmark (exact match from the list in benchmarks/index.js). |
--list-benchmarks |
Print all available benchmark names and exit. |
node index.js <bin1> <bin2> <bin3> [...]Presets are self-contained benchmark configurations inside presets/<name>/. Each subfolder contains:
- The binary
.exefiles to compare. - A
run.bat(Windows) orrun.sh(Linux) script that executes the benchmark.
| Preset | Description |
|---|---|
msvc-vs-clangcl |
Compares MSVC-compiled vs ClangCL-compiled Node.js binaries (Windows). |
linux |
Compares clean, LTO, PGO, and LTO+PGO Node.js builds (Linux). |
wpr/node |
Per-benchmark WPR profiling — captures a separate ETL trace for each benchmark (Windows). |
cd presets\msvc-vs-clangcl
run.bat- Create a subfolder under
presets/(e.g.presets/my-test/). - Place the binaries inside it.
- Add a
run.bat/run.shthatcds to its own directory and invokes../../index.jswith the binary names.
- Iterations: 30 per benchmark, 10 warmup rounds.
- Run order is randomized (Fisher-Yates shuffle) each iteration to minimize cache/scheduling bias.
- Winner is determined by median; ties are detected statistically using stddev.
- Summary shows win counts and a weighted percentage advantage per binary.