Skip to content

JaneaSystems/node-msvc-clangcl-perf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-msvc-clangcl-perf

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.

Scripts

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.

Usage

Single binary (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.

Two or more binaries

node index.js <bin1> <bin2> <bin3> [...]

Presets

Presets are self-contained benchmark configurations inside presets/<name>/. Each subfolder contains:

  • The binary .exe files to compare.
  • A run.bat (Windows) or run.sh (Linux) script that executes the benchmark.

Available presets

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).

Running a preset

cd presets\msvc-vs-clangcl
run.bat

Creating a new preset

  1. Create a subfolder under presets/ (e.g. presets/my-test/).
  2. Place the binaries inside it.
  3. Add a run.bat / run.sh that cds to its own directory and invokes ../../index.js with the binary names.

How it works

  • 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.

About

A simple project for benchmarking differences between MSVC and ClangCL in Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors