use hyperfine #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Manager Benchmarks | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '22' | |
- name: Install npm | |
run: npm install -g npm | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install bun | |
run: curl -fsSL https://bun.sh/install | bash | |
- name: Install deno | |
run: curl -fsSL https://deno.land/x/install/install.sh | sh | |
- name: Install hyperfine | |
run: sudo apt-get install -y hyperfine | |
- name: Benchmark package managers | |
run: | | |
echo "Benchmarking npm (cold cache)..." | |
hyperfine --prepare 'rm -rf node_modules package-lock.json' 'npm install' --export-markdown npm_cold.md | |
echo "Benchmarking npm (warm cache)..." | |
hyperfine 'npm install' --export-markdown npm_warm.md | |
echo "Benchmarking yarn (cold cache)..." | |
hyperfine --prepare 'rm -rf node_modules yarn.lock' 'yarn install' --export-markdown yarn_cold.md | |
echo "Benchmarking yarn (warm cache)..." | |
hyperfine 'yarn install' --export-markdown yarn_warm.md | |
echo "Benchmarking pnpm (cold cache)..." | |
hyperfine --prepare 'rm -rf node_modules pnpm-lock.yaml' 'pnpm install' --export-markdown pnpm_cold.md | |
echo "Benchmarking pnpm (warm cache)..." | |
hyperfine 'pnpm install' --export-markdown pnpm_warm.md | |
echo "Benchmarking bun (cold cache)..." | |
hyperfine --prepare 'rm -rf node_modules bun.lockb' 'bun install' --export-markdown bun_cold.md | |
echo "Benchmarking bun (warm cache)..." | |
hyperfine 'bun install' --export-markdown bun_warm.md | |
echo "Benchmarking deno (cold cache)..." | |
hyperfine --prepare 'rm -rf deno_modules' 'deno cache' --export-markdown deno_cold.md | |
echo "Benchmarking deno (warm cache)..." | |
hyperfine 'deno cache' --export-markdown deno_warm.md | |
echo "Benchmark Results:" | |
cat npm_cold.md | |
cat npm_warm.md | |
cat yarn_cold.md | |
cat yarn_warm.md | |
cat pnpm_cold.md | |
cat pnpm_warm.md | |
cat bun_cold.md | |
cat bun_warm.md | |
cat deno_cold.md | |
cat deno_warm.md |