oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.07k stars 2.76k forks source link

Add --ignore-scripts option on bun install command shown in the benchmark #7900

Open ayushk7 opened 10 months ago

ayushk7 commented 10 months ago

What is the type of issue?

Documentation is incorrect, Documentation is confusing

What is the issue?

The benchmark image shown doesn't have the --ignore-scripts flag for the bun install, where as for other package managers it is there. image

I was following the same command, and found out the bun install --backend=hardlink was slower than pnpm install --ignore-scripts by a factor of 20 because bun was also doing the postinstall for some package. And when I added the flag (bun install --backend=hardlink --ignore-scripts) bun was indeed faster.

Where did you find it?

https://bun.sh/docs/cli/install#:~:text=%E2%9A%A1%EF%B8%8F-,25x%20faster,-%E2%80%94%20Switch%20from%20npm

Jarred-Sumner commented 10 months ago

At the time it was created, bun didn’t run the install scripts

SergeiMinaev commented 1 week ago

When I decided to check the '25x faster' claim and ran the benchmark command on my PC, the winner was pmpm, which left me confused. With --ignore-scripts option, the winner was bun, but it was only 4.5x faster than npm. '25x faster' is a very bold claim.

   bun install --backend=hardlink --ignore-scripts ran
    1.11 ± 0.05 times faster than pnpm install --ignore-scripts
    4.40 ± 0.22 times faster than npm install --no-scripts --ignore-scripts
    4.85 ± 0.46 times faster than yarn install --no-scripts

Anyway, --no-scripts is rarely used in real life. With simply install command the results is even worse:

$ hyperfine  "bun install" "yarn install" "npm install" "pnpm install" --prepare "rm -rf node_modules" --warmup=1 --runs 3

  pnpm install ran
    1.50 ± 0.04 times faster than bun install
    3.64 ± 0.51 times faster than yarn install
    4.04 ± 0.18 times faster than npm install

I'm still confused.