Repository navigation
Perf regression: bun/hosted wall +110% (1169ae68, #472) #578
Description
Activity
- addedpm:bunBunBunbenchsocket-patch scan benchmark suitesocket-patch scan benchmark suiteperf-regressionConfirmed performance regressionConfirmed performance regression
on Oct 2, 2026 mikolalysenko commented
on Oct 2, 2026 CollaboratorAuthorMore actions[agent] Triaged as
priority:p1(Bun, npm-family). Confirmed onmain(6cd3754):rewrite_bun_lock(patch/redirect/mod.rs:3723) still callsis_bundled_entrybefore the spec compare, andvendor/bun_lock.rs:1048filters the same way. Related to #579 (same culprit, #472) but a different hot spot and fix, so not clustered. No open PR addresses it.
Generated by Claude Code
mikolalysenko commented
on Oct 3, 2026 CollaboratorAuthorMore actions[agent] Bench: still regressed on
main045d7ec7(2026-10-03 run).round base scenario base wall head wall Δ wall [95% CI] Δ CPU requests weekly, 7 pairs + confirm 2463257a(#277)bun/hosted142.3 ms 301.5 ms +116.6% [+108.1, +123.6] +92.4% 127 weekly, 7 pairs + confirm 2463257a(#277)bun/rescan127.8 ms 286.1 ms +124.7% [+112.7, +132.1] +104.3% 127 daily, 9 pairs 1169ae68(#472)bun/hosted312.4 ms 314.7 ms −0.7% [−3.2, +6.4] −0.3% 127 None of the commits since #472 touched the Bun rewrite:
rewrite_bun_lockstill callsis_bundled_entry(entry)before it compares the spec. The A/A check on this runner was clean. The newbun-isolated/*scenario in #667, which uses Bun's isolated.bunstore, runs at about the same 320 ms, so it most likely has the same hot spot.Runner: 4 vCPU, Intel(R) Xeon(R) Processor @ 2.80GHz, cloud sandbox.
Generated by Claude Code
mikolalysenko commented
on Oct 4, 2026 CollaboratorAuthorMore actions[agent] Bench: still regressed on
main045d7ec7(2026-10-04 run). main hasn't moved since the 10-03 run, so there was no daily A/B.round base scenario base wall head wall Δ wall [95% CI] Δ CPU requests weekly, 7 pairs + 10 confirm 2463257a(#277)bun/hosted134.4 ms 298.2 ms +116.7% [+113.3, +127.9] +105.0% 127 = 127 weekly, 7 pairs + 10 confirm 2463257a(#277)bun/rescan125.6 ms 284.6 ms +126.7% [+118.8, +140.0] +106.4% 127 = 127 A/A on the same runner was clean (npm/hosted −1.0%, vlt/hosted +0.9%, poetry/hosted −0.4%). Runner: 4 vCPU Intel Xeon @ 2.10GHz.
For reference, the matching vlt regression (#579) was closed by a maintainer as an accepted cost of scanning previously skipped copies. If the same reasoning applies to Bun's bundled-entry check, this can be closed the same way. The bench steward won't close it, since a human triaged it.
Generated by Claude Code
mikolalysenko commented
on Oct 5, 2026 CollaboratorAuthorMore actions[agent] Bench: still regressed on
main045d7ec7(2026-10-05 run). main hasn't moved since 10-02, so there was no daily A/B.round base scenario base wall head wall Δ wall verdict weekly, 7 + 10 confirm pairs 2463257a(#277)bun/hosted181.5 ms 369.9 ms +107.3% Regression weekly, 7 + 10 confirm pairs 2463257a(#277)bun/rescan201.8 ms 386.1 ms +92.2% Regression The A/A check (npm/hosted, uv/hosted, poetry/hosted) was clean: +1.6%, +0.8% and +0.2%. Runner: 4 vCPU Intel Xeon @ 2.80GHz. The hot spot is unchanged (see earlier comments). No new data argues either for or against accepting this the way #579 was. That decision is still with a human.
Generated by Claude Code
mikolalysenko commented
on Oct 6, 2026 CollaboratorAuthorMore actions[agent] Bench: run 2026-10-06. The regression is still present on main
9c43dfc9.This run used a same-machine interleaved weekly A/B against
2463257a(#277) on a 4 vCPU Xeon @ 2.10GHz:scenario base wall head wall Δ wall [95% CI] Δ CPU bun/hosted148.2 ms 314.1 ms +111.6% [+92.2, +121.0] +97.2% bun/rescan135.9 ms 299.6 ms +122.5% [+114.7, +137.0] +103.8% The daily A/B against
045d7ec7was flat: bun/hosted +0.8%, bun/rescan +5.4%. None of the 74 commits since the last run touched this regression. Requests are unchanged at 127.
Generated by Claude Code
mikolalysenko commented
on Oct 7, 2026 CollaboratorAuthorMore actions[agent] Bench: run 2026-10-07. Still regressed on
main9c43dfc9. main hasn't moved since the 10-06 run, so there was no daily A/B.Weekly same-machine
compare(base2463257a→ head9c43dfc9, 4 vCPU Xeon @ 2.80GHz):scenario base wall head wall Δ wall [95% CI] Δ CPU requests bun/hosted210.0 ms 414.3 ms +99.2% [+85.2, +104.3] +84.7% 127 bun/rescan216.0 ms 425.1 ms +98.7% [+89.2, +110.2] +83.7% 127 A/A on this runner was clean. Nothing has changed since the last comment: the culprit is still #472, and accepting it the way #579 was is still a human call.
Generated by Claude Code
mikolalysenko commented
on Oct 7, 2026 CollaboratorAuthorMore actionsClaim-ID: agent/fix-bun-open-issues. Draft fix PR: #1009 (it covers all open
pm:bunissues).- added 4 commits that reference this issue
on Oct 7, 2026 mikolalysenko commented
on Oct 8, 2026 CollaboratorAuthorMore actions[agent] Bench: run 2026-10-08. Still regressed on main
ea097142.Weekly same-machine interleaved
compare, base2463257a(#277) → headea097142, on a 4 vCPU Xeon @ 2.10GHz. A/A was clean.scenario base wall head wall Δ wall [95% CI] Δ CPU requests bun/hosted170.3 ms 346.6 ms +102.1% [+82.3, +115.3] +91.1% 127 (=) bun/rescan137.4 ms 318.6 ms +125.5% [+117.5, +142.2] +105.9% 127 (=) Daily (
9c43dfc9→ea097142): bun/hosted -2.8%, bun/rescan +1.9%. Nothing that landed today moved it. #1009 is the open fix.
Generated by Claude Code
- added a commit that references this issue
on Oct 8, 2026 mikolalysenko commented
on Oct 9, 2026 CollaboratorAuthorMore actions[agent] Bench: run 2026-10-09. bun is back at its pre-#472 speed on main
f3c6313a. #1051 (830749f9, "Stop re-parsing bun lock entries for every patch in scan") landed in this range.Same-machine interleaved
compareon a 4 vCPU Xeon @ 2.80GHz. A/A was clean.Daily,
ea097142→f3c6313a:scenario base wall head wall Δ wall [95% CI] Δ CPU requests bun/hosted395.7 ms 188.2 ms -53.3% [-55.2, -52.1] -49.9% 127 bun/rescan410.2 ms 153.4 ms -61.7% [-66.1, -60.0] -56.9% 127 bun-isolated/hosted457.6 ms 230.0 ms -51.8% [-56.0, -46.7] -40.6% 127 bun-isolated/rescan438.4 ms 188.2 ms -56.0% [-58.6, -51.6] -45.4% 127 Weekly, against
61cfb9b2, which predates #472 (1169ae68) and so serves as the pre-regression baseline:scenario base wall head wall Δ wall [95% CI] Δ CPU requests bun/hosted238.9 ms 244.3 ms -8.1% [-13.1, +15.3] -0.8% 127 bun/rescan197.5 ms 147.4 ms -26.3% [-30.8, -14.5] -19.3% 127 That is run 1 of 2 within 5% of the pre-regression baseline. If tomorrow's run agrees, this issue can close. It stays open for now; #1009 is still open for the other bun issues.
Generated by Claude Code
[agent] Bench:
bun/hostedandbun/rescantake about 2.1x as long since #472 (1169ae6, "Fix Bun/vlt bundled copies left unpatched"). Wall time is up 105–117% and CPU time 88–96%. The request count is unchanged (127).Same-machine interleaved
compare(socket-patch-bench, PR #485 suite)6e7ef748(main −24h)bun/hosted6e7ef748bun/rescan6e7ef748bun/hosted6e7ef748bun/rescancbf1f748(parent of #472)bun/hostedAn A/A check on the same runner (head against a copy of itself, 3 scenarios) found no regression, so the runner was not too noisy.
1169ae68(main), with the bench suite from Add ascanbenchmark suite and a CI performance gate #485 merged locally6e7ef748..1169ae68that touches Bun code, and the parent→Fix Bun/vlt bundled copies left unpatched (#469, #471) #472 A/B reproduces the full slowdown.Hot spot
Callgrind on
bun/hosted(head) puts 62% of all instructions insocket_patch_core::vendor::bun_lock_text::is_bundled_entry, nearly all of it insideserde_json::from_str::<Value>.rewrite_bun_lock(crates/socket-patch-core/src/patch/redirect/mod.rs, thefor dep in &npm { for entry in &entries {loop) callsis_bundled_entry(entry)before it checks the spec:That parses every entry's metadata object as JSON once per patched dependency: 60 patches × 3000 entries is 180k JSON parses, where the old loop did string compares. Proposed fix (not applied):
is_bundled_entryonly runs on a matching entry; orbundledonce per entry before thedeploop.The behavior stays the same either way.
bundled_matchesinvendor/bun_lock.rshas the same shape (it filters onis_bundled_entryfirst) on the vendor path.Repro
Runner: 4 vCPU (
nproc= 4), Intel(R) Xeon(R) Processor @ 2.10GHz, cloud sandbox.Generated by Claude Code
Backlog review — 2026-10-08
Priority: P1 → P2. The Bun regression is measurable and worth fixing, but the supplied subsecond benchmark does not establish a P1 user-facing performance outage.