Skip to content
Eugene Lazutkin edited this page Feb 23, 2026 · 14 revisions

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

Two utilities are available:

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

It is advisable to familiarize yourself with the underlying concepts first.

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