Skip to content

perf(snapshots): reduce registry traffic with local fixtures and caching - #3067

Merged
fengmk2 merged 15 commits into
mainfrom
perf/snapshot-local-registry
Oct 18, 2026
Merged

fengmk2 merged 15 commits into
mainfrom
perf/snapshot-local-registry

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Snapshot tests repeatedly download package metadata and tarballs. The runner now serves recorded packages and shares a response cache for each run. Concurrent requests share one download. Stalled downloads release their cache locks so clients can retry.

Tests for dlx, vpx, global binary lookup, and native pnpm shims use local CLI packages. These packages replace cowsay and lolcatjs. Recorded is-number and yocto-queue packages retain their published contents. Two monorepo cases use a fixed library template. Registry fixtures change only through explicit maintenance commands. Their packers use only Node.js builtins, with fixed timestamps and file modes.

Cases share separate servers for published packages and packed checkout packages. Windows keeps both servers alive across nextest processes. Cases with fixture overrides, custom registry configuration, or request-count assertions keep private servers. Package-manager caches and installed packages remain isolated per case. The tests still execute real package managers and toolchains.

The CI comparison uses one complete run per revision. Each value is the slowest Run PTY snapshot tests step across three shards, with eight workers per shard. Each PR run starts with an empty registry response cache. The comparison excludes build, setup, and queue time. Linux uses GitHub ubuntu-latest runners. macOS and Windows use Namespace runners.

The revisions use the same product code, dependency lockfiles, and test cases:

  • main: afbe4a285, CI run.
  • Previous PR revision: 7d6f7264a, CI run.
  • Revision with server reuse: 913877a92, CI run.
Platform main Previous PR revision With server reuse Change from previous revision
macOS ARM64 2m 29s 2m 10s 2m 08s -1.5%
Linux x64 4m 26s 4m 09s 3m 52s -6.8%
Windows 2m 26s 2m 31s 2m 09s -14.6%

Across all shards, upstream requests changed from 15,325 to 15,331 between the previous revision and the revision with server reuse. Server reuse targets repeated startup work. Cumulative per-case registry setup on Windows fell from 150.0 seconds to 7.7 seconds. These phases overlap during execution.

All comparison runs passed. These are single-run measurements, so runner and network variation can affect the timings. The macOS difference is too small to establish an improvement.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://perf-snapshot-local-registry-viteplus-dev.voidzero-docs.workers.dev (commit 9caeede)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://42a1e9eb-viteplus-dev.voidzero-docs.workers.dev 9caeede 2026-10-18T12:02:30.742Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://5a8c0fb6-viteplus-dev.voidzero-docs.workers.dev 41b3c67 2026-10-18T11:33:21.690Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f3cafba0-viteplus-dev.voidzero-docs.workers.dev b844325 2026-10-18T11:17:56.184Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://2e183573-viteplus-dev.voidzero-docs.workers.dev 9db2a13 2026-10-18T10:30:18.620Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://7a6468da-viteplus-dev.voidzero-docs.workers.dev 57014d4 2026-10-18T09:11:49.154Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://078d0102-viteplus-dev.voidzero-docs.workers.dev 2423811 2026-10-18T08:32:19.472Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://94533618-viteplus-dev.voidzero-docs.workers.dev 018dac8 2026-10-16T13:49:08.819Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://166d0249-viteplus-dev.voidzero-docs.workers.dev 913877a 2026-10-16T13:21:05.456Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://d29b2513-viteplus-dev.voidzero-docs.workers.dev 7d6f726 2026-10-16T11:10:24.832Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://8581028e-viteplus-dev.voidzero-docs.workers.dev 6d71faa 2026-10-16T11:05:55.055Z Visit the dashboard ↗

View all previews: View all previews ↗

@socket-security

socket-security Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​types/​node@​26.6.51001008195100
Addednpm/​bumpp@​12.3.09910010095100

View full report

@fengmk2
fengmk2 force-pushed the perf/snapshot-local-registry branch 3 times, most recently from 1d0ae17 to 6d71faa Compare October 16, 2026 11:05
@fengmk2 fengmk2 self-assigned this Oct 16, 2026
@fengmk2

fengmk2 commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T09:19:22.724318Z 57014d4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fengmk2
fengmk2 force-pushed the perf/snapshot-local-registry branch from 018dac8 to 2423811 Compare October 18, 2026 08:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 018dac8960

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2
fengmk2 marked this pull request as ready for review October 18, 2026 09:14
@fengmk2

fengmk2 commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 57014d4bcd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2
fengmk2 force-pushed the perf/snapshot-local-registry branch from 57014d4 to 9db2a13 Compare October 18, 2026 10:29
@fengmk2
fengmk2 requested a review from cpojer October 18, 2026 11:08
@fengmk2
fengmk2 force-pushed the perf/snapshot-local-registry branch from 41b3c67 to 9caeede Compare October 18, 2026 12:01
@fengmk2
fengmk2 merged commit c337f45 into main Oct 18, 2026
71 checks passed
@fengmk2
fengmk2 deleted the perf/snapshot-local-registry branch October 18, 2026 12:37
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