Skip to content

feat: Officially support bun and add it to CI#1129

Open
kjvalencik wants to merge 2 commits intomainfrom
kv/bun
Open

feat: Officially support bun and add it to CI#1129
kjvalencik wants to merge 2 commits intomainfrom
kv/bun

Conversation

@kjvalencik
Copy link
Copy Markdown
Member

@kjvalencik kjvalencik commented Dec 12, 2025

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 12, 2025

🐰 Bencher Report

Branchkv/bun
Testbedubuntu-latest

🚨 12 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Lower Boundary
(Limit %)
Upper Boundary
(Limit %)
JsFunction::bindLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
181.34 ns
(-11.00%)Baseline: 203.75 ns
183.37 ns
(101.12%)

407.50 ns
(44.50%)
JsFunction::bindThroughput
operations / second (ops/s)
📈 plot
🚷 threshold
🚨 alert (🔔)
5,507,706.23 ops/s
(+12.30%)Baseline: 4,904,671.47 ops/s
0.00 ops/s
(0.00%)
5,395,138.62 ops/s
(102.09%)

JsFunction::callLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
190.37 ns
(-11.79%)Baseline: 215.82 ns
194.24 ns
(102.03%)

431.64 ns
(44.10%)
JsFunction::callThroughput
operations / second (ops/s)
📈 plot
🚷 threshold
🚨 alert (🔔)
5,249,075.27 ops/s
(+13.60%)Baseline: 4,620,730.79 ops/s
0.00 ops/s
(0.00%)
5,082,803.87 ops/s
(103.27%)

JsFunction::call_withLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
181.28 ns
(-10.61%)Baseline: 202.79 ns
182.51 ns
(100.68%)

405.58 ns
(44.70%)
JsFunction::call_withThroughput
operations / second (ops/s)
📈 plot
🚷 threshold
🚨 alert (🔔)
5,474,267.35 ops/s
(+11.40%)Baseline: 4,914,160.49 ops/s
0.00 ops/s
(0.00%)
5,405,576.54 ops/s
(101.27%)

auto-exported-noopLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
25.29 ns
(-14.34%)Baseline: 29.52 ns
26.57 ns
(105.06%)

59.03 ns
(42.83%)
auto-exported-noopThroughput
operations / second (ops/s)
📈 plot
🚷 threshold
🚨 alert (🔔)
39,261,731.52 ops/s
(+14.53%)Baseline: 34,279,569.52 ops/s
0.00 ops/s
(0.00%)
37,707,526.47 ops/s
(104.12%)

hello-worldLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
51.82 ns
(-10.87%)Baseline: 58.14 ns
52.33 ns
(100.98%)

116.28 ns
(44.56%)
hello-worldThroughput
operations / second (ops/s)
📈 plot
🚷 threshold
🚨 alert (🔔)
19,208,400.44 ops/s
(+11.42%)Baseline: 17,239,641.41 ops/s
0.00 ops/s
(0.00%)
18,963,605.55 ops/s
(101.29%)

manually-exported-noopLatency
nanoseconds (ns)
📈 plot
🚷 threshold
🚨 alert (🔔)
25.36 ns
(-10.68%)Baseline: 28.39 ns
25.55 ns
(100.76%)

56.78 ns
(44.66%)
manually-exported-noopThroughput
operations / second (ops/s)
📈 plot
🚷 threshold
🚨 alert (🔔)
39,475,114.79 ops/s
(+12.08%)Baseline: 35,221,236.31 ops/s
0.00 ops/s
(0.00%)
38,743,359.94 ops/s
(101.89%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Lower Boundary
nanoseconds (ns)
(Limit %)
Upper Boundary
nanoseconds (ns)
(Limit %)
ThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
Upper Boundary
operations / second (ops/s)
(Limit %)
JsFunction::bind📈 view plot
🚷 view threshold
🚨 view alert (🔔)
181.34 ns
(-11.00%)Baseline: 203.75 ns
183.37 ns
(101.12%)

407.50 ns
(44.50%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
5,507,706.23 ops/s
(+12.30%)Baseline: 4,904,671.47 ops/s
0.00 ops/s
(0.00%)
5,395,138.62 ops/s
(102.09%)

JsFunction::call📈 view plot
🚷 view threshold
🚨 view alert (🔔)
190.37 ns
(-11.79%)Baseline: 215.82 ns
194.24 ns
(102.03%)

431.64 ns
(44.10%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
5,249,075.27 ops/s
(+13.60%)Baseline: 4,620,730.79 ops/s
0.00 ops/s
(0.00%)
5,082,803.87 ops/s
(103.27%)

JsFunction::call_with📈 view plot
🚷 view threshold
🚨 view alert (🔔)
181.28 ns
(-10.61%)Baseline: 202.79 ns
182.51 ns
(100.68%)

405.58 ns
(44.70%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
5,474,267.35 ops/s
(+11.40%)Baseline: 4,914,160.49 ops/s
0.00 ops/s
(0.00%)
5,405,576.54 ops/s
(101.27%)

auto-exported-noop📈 view plot
🚷 view threshold
🚨 view alert (🔔)
25.29 ns
(-14.34%)Baseline: 29.52 ns
26.57 ns
(105.06%)

59.03 ns
(42.83%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
39,261,731.52 ops/s
(+14.53%)Baseline: 34,279,569.52 ops/s
0.00 ops/s
(0.00%)
37,707,526.47 ops/s
(104.12%)

hello-world📈 view plot
🚷 view threshold
🚨 view alert (🔔)
51.82 ns
(-10.87%)Baseline: 58.14 ns
52.33 ns
(100.98%)

116.28 ns
(44.56%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
19,208,400.44 ops/s
(+11.42%)Baseline: 17,239,641.41 ops/s
0.00 ops/s
(0.00%)
18,963,605.55 ops/s
(101.29%)

manually-exported-noop📈 view plot
🚷 view threshold
🚨 view alert (🔔)
25.36 ns
(-10.68%)Baseline: 28.39 ns
25.55 ns
(100.76%)

56.78 ns
(44.66%)
📈 view plot
🚷 view threshold
🚨 view alert (🔔)
39,475,114.79 ops/s
(+12.08%)Baseline: 35,221,236.31 ops/s
0.00 ops/s
(0.00%)
38,743,359.94 ops/s
(101.89%)

🐰 View full continuous benchmarking report in Bencher

@kjvalencik kjvalencik force-pushed the kv/bun branch 3 times, most recently from ba31034 to cfdace3 Compare December 12, 2025 18:52
"license": "MIT",
"scripts": {
"install": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics",
"install": "cargo-cp-artifact -ac electron-tests index.node -- cargo build --message-format=json-render-diagnostics",
Copy link
Copy Markdown
Member Author

@kjvalencik kjvalencik Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we install with bun instead of npm, we don't get the automatic package name inference.

Comment thread .gitignore
# Node
**/node_modules
npm-debug.log
bun.lock
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bun install --lockfile-only can convert a package-lock.json. To avoid having two lockfiles that we need to keep in sync, the Node lock file gets converted in CI.

Comment thread test/napi/lib/workers.js
describe("Multi-Threaded", () => {
it("should fail to use `get_and_replace`", (cb) => {
const worker = new Worker(__filename);
after(() => worker.terminate());
Copy link
Copy Markdown
Member Author

@kjvalencik kjvalencik Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not ever completing and I'm not sure why. unref() accomplishes the same thing and side steps the issue.

#1128 (comment)

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.80%. Comparing base (303eb3c) to head (b6bfdcb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1129      +/-   ##
==========================================
- Coverage   83.16%   82.80%   -0.37%     
==========================================
  Files          80       81       +1     
  Lines        5739     5756      +17     
  Branches     5739     5756      +17     
==========================================
- Hits         4773     4766       -7     
- Misses        848      871      +23     
- Partials      118      119       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants