Skip to content
Eugene Lazutkin edited this page Jul 8, 2026 · 14 revisions

nano-benchmark

Node.js CI NPM version

nano-benchmark provides command-line utilities for micro-benchmarking code with nonparametric statistics and significance testing. Node, Deno and Bun are supported.

Search

🔍 Search this wiki — ranked, deep-linked search via wiki-search; install the bookmarklet to search in place. Fallback: GitHub wiki search.

Documentation

CLI tools

  • nano-watch — continuously benchmarks a single function, showing live statistics and memory usage.
  • nano-bench — benchmarks and compares multiple functions, calculating confidence intervals and statistical significance.
  • nano-bench-io — benchmarks slow (ms-scale) functions one call per run — distributions and tail percentiles (p90/p99), no batching.
  • nano-bench-compare — views and compares saved results (JSON), recomputing significance from the raw samples — for before/after comparisons across runs.

Background

  • Concepts — background on the approach and the statistics behind it.

Reference

Deno, Bun, etc.

Use --self to get the script path for running with alternative interpreters:

$ npx nano-bench benchmark.js
$ bun `npx nano-bench --self` benchmark.js
$ deno run --allow-read --allow-hrtime `npx nano-bench --self` benchmark.js
$ deno run -A `npx nano-bench --self` benchmark.js
$ node `npx nano-bench --self` benchmark.js

Clone this wiki locally