Skip to content

feat(perf-kit): add the Worker leads and keep rules from the startup A/B runs - #11479

Merged
IWANABETHATGUY merged 0 commit into
feat/perf-kit-worker-module-callsfrom
feat/perf-kit-worker-agent-leads
Nov 4, 2026
Merged

IWANABETHATGUY merged 0 commit into
feat/perf-kit-worker-module-callsfrom
feat/perf-kit-worker-agent-leads

Conversation

@IWANABETHATGUY

@IWANABETHATGUY IWANABETHATGUY commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Builds on #11415.

These are the perf-kit changes from the Worker startup A/B runs. In each run, an agent lowered the startup CPU of a Worker app. One arm got only the task, and the other arm also got perf-kit. Each change below comes from a run where the perf-kit arm did worse than the task-only arm, or broke the app.

  • New worker-scan leads. Imports of the main module that only code inside functions reads (the handlers), priced together and one at a time. Imports in the other app modules that only async functions read. Startup CPU by import, with a what-if estimate of GC and parse/compile by bytes. Packages that a chunk group loads at startup although only dynamic imports reach them.
  • Class exports priced as lazy wrapper classes. Workflow and Durable Object classes are priced apart, with the modules that leave startup only when the wrappers and the handler imports move together.
  • A keep rule that machine load cannot move. Against the pinned build, the scan prints the startup closure and the loaded bytes that changed. It prints KEEP when the time stays within noise and startup lost 1% of its bytes or 10% of its modules. Beyond the 3 ms floor, the timing pairs must agree (4 of 5, 7 of 9).
  • The task decides on code the first request needs. The rules told the agent to stop there, because such a deferral does not help the first request. It still lowers startup, so on a startup task the agent stopped too early.
  • Wrappers extend the runtime base class. A Durable Object wrapper that does not extend DurableObject breaks every RPC call on its stub, and fetch still works, so a route check does not show it. A check run made this mistake before the rule existed.

A check on three Worker apps outside these runs: with perf-kit, the agent did as well as without it on two apps and much better on the third.

@netlify

netlify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 450cdb4
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6aeafb4b528eb95a76d35b64
😎 Deploy Preview https://deploy-preview-11479--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://feat-perf-kit-worker-agent-leads-rolldown-rs.voidzero-docs.workers.dev (commit 450cdb4)

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://f84a95ac-rolldown-rs.voidzero-docs.workers.dev 450cdb4 2026-11-04T09:33:01.084Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6e69b048-rolldown-rs.voidzero-docs.workers.dev affc3a0 2026-11-04T09:23:49.438Z Visit the dashboard ↗

@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/perf-kit-worker-agent-leads branch from affc3a0 to 450cdb4 Compare November 4, 2026 09:30
@IWANABETHATGUY
IWANABETHATGUY marked this pull request as ready for review November 4, 2026 09:32
@IWANABETHATGUY
IWANABETHATGUY merged commit 44e6629 into main Nov 4, 2026
5 checks passed
@IWANABETHATGUY
IWANABETHATGUY deleted the feat/perf-kit-worker-agent-leads branch November 4, 2026 10:08
shulaoda added a commit that referenced this pull request Nov 5, 2026
## [0.1.0] - 2026-11-05

### 🚀 Features

- perf-kit: add the Worker leads and keep rules from the startup A/B
runs (#11479) by @IWANABETHATGUY
- perf-kit: show module-scope calls and compare with the pinned build in
the same Worker scan (#11415) by @IWANABETHATGUY
- perf-kit: measure the deployed site and replay it for local builds
(#11215) by @IWANABETHATGUY
- perf-kit: diagnose chunk loading before FCP and LCP (#11214) by
@IWANABETHATGUY
- perf-kit: Cloudflare Worker startup mode (#11188) by @IWANABETHATGUY

### 🐛 Bug Fixes

- perf-kit: Worker mode with nested rolldown, external bindings,
redirects (#11498) by @IWANABETHATGUY
- perf-kit: make Worker mode work on more app setups (#11414) by
@IWANABETHATGUY

### 📚 Documentation

- add build report and perf-kit in-depth pages (#11480) by
@IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- perf-kit: keep run details out of code comments (#11481) by
@IWANABETHATGUY

Co-authored-by: shulaoda <[email protected]>

This branch had an error being deployed

1 failed deployment
void — 44e6629a Deployed Nov 4, 2026 by IWANABETHATGUY via Deploy to Void #7200
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