Bench: cover Bun isolated .bun store layout - #667
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
Bun 1.3.2+ installs with the isolated linker by default, keeping every package only in node_modules/.bun/<name>@<version>/node_modules/<name>. #496 taught the npm crawler (scan, apply's resolver, VEX) to walk that store, but the suite only had a hoisted Bun layout, so the new walk was never timed and a regression back to "2700 lockfile-only packages" would have gone unnoticed. Add bun-isolated/{hosted,rescan}: the same text bun.lock as bun/*, with a pnpm-shaped .bun store, per-entry dependency links, Bun's .bun/node_modules hoist links and root links for direct deps only. A pre-#496 binary fails it (lockfileOnlyPackages: got 2700, want 0). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5ab8e87. Configure here.
|
Ready for review at
Generated by Claude Code |
|
Codex review of Reviewed all three changed files, fixture registration, dependency/version resolution, and scoped/unscoped symlink targets. Validation passed:
Full current-head CI is clear: 245 successful checks, six skipped; six successful workflows, two skipped. Exact-head Bugbot is clear, with no unresolved review threads. The unchanged source merges cleanly with current main The two debug scenario runs validate correctness; they do not independently establish the author's performance comparison. No source changes were needed. |
What main changed
#496 (
35de7548, "Fix npm crawler missing Bun, Deno and Yarn 4 stores") made the npm crawler walk Bun's isolated store,node_modules/.bun/<name>@<version>/node_modules/<name>, in scan, apply's resolver and VEX. Bun 1.3.2+ uses the isolated linker by default. The suite only had a hoisted Bun project (bun/*), so this path was never timed or validated.Suite changes
bun-isolated/hostedandbun-isolated/rescan(3000 packages, 60 patched). They use the same textbun.lockgenerator asbun/*, with a pnpm-shaped.bunstore: per-entry dependency symlinks, Bun's.bun/node_moduleshoist links, and root links for direct dependencies only, so 2700 of the 3000 packages exist only in the store. TheExpectmatchesbun/*: every package scanned, 60 redirected,bun.lockrewritten.Validation (4 vCPU Intel Xeon @ 2.80GHz cloud sandbox)
runon main045d7ec7, 3 runs:bun-isolated/hosted321.9 ms,bun-isolated/rescan332.6 ms, 127 requests, 34.8 MiB peak RSS. Both validate.1169ae68) fails it withlockfileOnlyPackages: got 2700, want 0.compare(default 15 pairs): hosted +0.8% [−2.1, +6.1], rescan −0.7% [−4.0, +6.4]. No regression.strace -f -e trace=execveon aserverun shows onlyenv→socket-patch, so no subprocesses.cargo fmt -p socket-patch-bench,cargo clippy -p socket-patch-bench --all-features --all-targets -D warningsandcargo test -p socket-patch-bench(29 passed) are all clean.Time budget
A default (15-pair)
compareof the two new scenarios took 89 s on this sandbox, fixture builds included. On this machine a 9-pair compare of the existing 39 scenarios took 8.4 min. GitHub's 4-core runners have run faster than this sandbox so far, so a full default compare should stay near the ~12 min target. If it goes over,bun/rescanis the first candidate to drop, since its code path is now covered twice.🤖 Generated with Claude Code
https://claude.ai/code/session_01619Coyji7rSbf5YieWzhqu
Generated by Claude Code
Note
Low Risk
Benchmark-only fixture and docs; no production scan or CLI behavior changes.
Overview
Adds
bun-isolatedto the socket-patch bench suite so CI times and validates scans over Bun 1.3’s default isolatednode_modules/.bunlayout—the crawler path from #496 that hoistedbun/*never exercised.The new fixture reuses the same text
bun.lockasbun, but lays down a pnpm-shaped store (per-package dirs under.bun, dependency symlinks, hoist links in.bun/node_modules, root links for direct deps only), with the same 3000-package / 60-patch expectations as hoisted Bun.fixtures::ALLregisters it forbun-isolated/hostedandbun-isolated/rescan; the README package-manager list now distinguishes hoistedbunfrombun-isolated.Reviewed by Cursor Bugbot for commit 5ab8e87. Configure here.
Generated by Claude Code