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

Introduce dedicated I/O threadpool for Bun.build on macOS & Windows #17577

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Jarred-Sumner
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner commented Feb 23, 2025

What does this PR do?

 hyperfine "bun build --outdir=dist ./src/index.jsx --minify --sourcemap" "bun-1.2.3 build --outdir=dist ./src/index.jsx --minify --sourcemap" --warmup=10
Benchmark 1: bun build --outdir=dist ./src/index.jsx --minify --sourcemap
  Time (mean ± σ):     375.6 ms ±   5.0 ms    [User: 499.3 ms, System: 657.6 ms]
  Range (min  max):   370.1 ms  383.2 ms    10 runs

Benchmark 2: bun-1.2.3 build --outdir=dist ./src/index.jsx --minify --sourcemap
  Time (mean ± σ):     653.9 ms ±   9.6 ms    [User: 581.8 ms, System: 5420.3 ms]
  Range (min  max):   637.5 ms  668.6 ms    10 runs

Summary
  bun build --outdir=dist ./src/index.jsx --minify --sourcemap ran
    1.74 ± 0.03 times faster than bun-1.2.3 build --outdir=dist ./src/index.jsx --minify --sourcemap

On the bun init shadcn app:

 hyperfine "bun ./build.ts" "bun-1.2.3 ./build.ts"
Benchmark 1: bun ./build.ts
  Time (mean ± σ):     156.8 ms ±   2.1 ms    [User: 364.6 ms, System: 462.6 ms]
  Range (min  max):   153.6 ms  161.6 ms    18 runs

Benchmark 2: bun-1.2.3 ./build.ts
  Time (mean ± σ):     176.1 ms ±   2.9 ms    [User: 351.9 ms, System: 776.0 ms]
  Range (min  max):   172.5 ms  182.2 ms    17 runs

Summary
  bun ./build.ts ran
    1.12 ± 0.02 times faster than bun-1.2.3 ./build.ts

How did you verify your code works?

Existing tests should cover this. Left two runtime feature flags in to explicitly turn on/off this behavior, so that we can later write more specific tests if needed.

@robobun
Copy link

robobun commented Feb 23, 2025

Updated 10:22 PM PT - Feb 22nd, 2025

@Jarred-Sumner, your commit 929d479 has 1 failures in Build #12104:


🧪   try this PR locally:

bunx bun-pr 17577

@Jarred-Sumner Jarred-Sumner changed the title Experiment Introduce dedicated I/O threadpool for Bun.build on macOS & Windows Feb 23, 2025
@Jarred-Sumner Jarred-Sumner marked this pull request as ready for review February 23, 2025 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants