To run the benchmark suite on your own machine, follow these steps in the benchmarks/ directory:
- Install dependencies:
npm install (installs jszip, fflate, and archiver). - Generate datasets:
npm run corpus. - Run head-to-head tables (compress/decompress/disk streaming):
node bench.js. - Run parallelism & codec-backend matrix:
node bench-backends.js. - Compare against 7-Zip (requires 7-Zip CLI installed):
deno run -A bench-7z.js or bun bench-7z.js.
Environment Variables & Flags:
ZIPJS_BACKEND=wasm: Forces the use of the WebAssembly codec instead of the native CompressionStream during 7-Zip comparisons.SKIP_HUGE=1: Skips the 256 MB combination test.RUNS=<n>: Sets the number of repetitions (default is 3).
cd benchmarks
npm install # jszip, fflate, archiver (zip.js is used from the repo)
npm run corpus # generate the deterministic datasets under .corpus/
node bench.js # the head-to-head tables (compress / decompress / disk streaming)
node bench-backends.js # the parallelism & codec-backend matrix
deno run -A bench-7z.js # zip.js vs the 7zz CLI (also: bun bench-7z.js)