Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bun install 60% faster on Windows, improve reliability, reduce memory usage #10037

Merged
merged 16 commits into from
Apr 8, 2024

Conversation

Jarred-Sumner
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner commented Apr 7, 2024

What does this PR do?

This changes the synchronization primitives used by bun install from using Go-like channels to instead use an unbounded mpmc queue with large pre-allocated contiguous structs that are recycled (only dynamically allocated when pre-allocated space runs out).

This fixes deadlocks that can occur when many different packages finish extracting simultaneously when the main thread goes to sleep.

This closes node_modules folders when there are async tasks, which fixes #10039.

On Windows, this makes installWithHardlinks run concurrently, which offers a 60% performance boost to cached installs.

Fixes #4066
Fixes #5142

image

How did you verify your code works?

CI

Copy link
Contributor

github-actions bot commented Apr 7, 2024

Copy link
Contributor

github-actions bot commented Apr 7, 2024

@Jarred-Sumner 2 files with test failures on bun-darwin-aarch64:

View test output

#a80697cc9703e42166467f3cd207604a397247e8

Copy link
Contributor

github-actions bot commented Apr 7, 2024

Copy link
Contributor

github-actions bot commented Apr 7, 2024

@Jarred-Sumner Jarred-Sumner changed the title [bundows] Make bun install 60% faster [bundows] Make bun install 60% faster, improve reliability, reduce memory usage Apr 8, 2024
@Jarred-Sumner Jarred-Sumner changed the title [bundows] Make bun install 60% faster, improve reliability, reduce memory usage Make bun install 60% faster on Windows, improve reliability, reduce memory usage Apr 8, 2024
@Jarred-Sumner Jarred-Sumner merged commit ee05bae into main Apr 8, 2024
26 of 31 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/faster-bun-install-bundows branch April 8, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant