Skip to content

performance improvement: restart a mixed mode session only if the worker's remote bindings have changed #9536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Jun 9, 2025

Fixes https://jira.cfdata.org/browse/DEVX-1893


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: this functionality is already tested
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: perf improvement of experimental/undocumented feature
  • Wrangler V3 Backport
    • TODO (before merge)
    • Wrangler PR:
    • Not necessary because: changes to a non-v3 feature

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner June 9, 2025 17:42
@dario-piotrowicz dario-piotrowicz added e2e Run wrangler + vite-plugin e2e tests on a PR skip-v3-pr Skip validation of presence of a v3 backport PR labels Jun 9, 2025
Copy link

changeset-bot bot commented Jun 9, 2025

🦋 Changeset detected

Latest commit: aad7ad8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Jun 9, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@9536

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@9536

miniflare

npm i https://pkg.pr.new/miniflare@9536

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@9536

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@9536

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@9536

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@9536

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@9536

wrangler

npm i https://pkg.pr.new/wrangler@9536

commit: aad7ad8

@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1856/mixed-mode-vitest branch from daf6c39 to 65339f7 Compare June 10, 2025 09:27
@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner June 10, 2025 09:27
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1893/mixed-mode-smarter-restart branch from 1a44f1c to 97eb219 Compare June 10, 2025 09:31
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1856/mixed-mode-vitest branch 2 times, most recently from cf47802 to 7a81fb2 Compare June 11, 2025 17:42
@dario-piotrowicz dario-piotrowicz marked this pull request as draft June 11, 2025 17:51
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1856/mixed-mode-vitest branch from 7a81fb2 to 90bcd4e Compare June 11, 2025 18:19
Base automatically changed from dario/DEVX-1856/mixed-mode-vitest to main June 12, 2025 13:28
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1893/mixed-mode-smarter-restart branch 2 times, most recently from ddf6ae7 to 459c8ac Compare June 12, 2025 15:47
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review June 12, 2025 15:47
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1893/mixed-mode-smarter-restart branch from 459c8ac to b4b90a9 Compare June 12, 2025 16:01
@dario-piotrowicz dario-piotrowicz force-pushed the dario/DEVX-1893/mixed-mode-smarter-restart branch from b4b90a9 to aad7ad8 Compare June 12, 2025 16:15
Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

This looks good to me, but a general question—what's the expected performance impact here? If the bindings are the same updating the remote session will effectively be a no-op, and it shouldn't make a difference to the user code, I don't think?

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jun 12, 2025
@dario-piotrowicz dario-piotrowicz added this pull request to the merge queue Jun 12, 2025
Merged via the queue into main with commit 3b61c41 Jun 12, 2025
21 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/DEVX-1893/mixed-mode-smarter-restart branch June 12, 2025 17:50
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 12, 2025
jseba added a commit to jseba/workers-sdk that referenced this pull request Jun 14, 2025
* 'main' of ssh://github.com/cloudflare/workers-sdk: (213 commits)
  fix(vite-plugin-cloudflare): allow unknown entrypoint on startup (cloudflare#9583)
  add warning about env not specified to potentially risky wrangler commands (cloudflare#9344)
  test: correctly delete test d1 databases (cloudflare#9598)
  Add details to v3 maintenance worflow error message (cloudflare#9602)
  drop unused `WRANGLER_UNENV_RESOLVE_PATHS` env var (cloudflare#9593)
  warn instead of erroring if no exposed ports. and remove unused dev_exposed_ports (cloudflare#9573)
  fix(wrangler): point to the right doc location (replaces cloudflare#9353) (cloudflare#9592)
  [vitest-pool-worker] Add `type: module` in package.json (cloudflare#9595)
  Enable HTML handling for HTML files in the public directory (cloudflare#9548)
  switch from go container to js (cloudflare#9588)
  containers: switch to Cloudflare container registry (cloudflare#9564)
  performance improvement: restart a mixed mode session only if the worker's remote bindings have changed (cloudflare#9536)
  ci: delete more orphaned resources from e2e tests (cloudflare#9580)
  test: remove `verifyBuildScript` logic from c3 e2e tests (cloudflare#9504)
  fix(vite-plugin): ensure node compat globals are injected before any imports (cloudflare#9581)
  feat(containers-shared): Move `isDockerfile` utility function to `containers-shared` (cloudflare#9577)
  allow `startWorker` to accept `false` as an `inspector` option (to disable the inspector server) (cloudflare#9550)
  Update capnp generated code from the workerd.capnp (cloudflare#9582)
  Bump `@cloudflare/unenv-preset` to 2.3.3 (cloudflare#9566)
  test: make custom build bundling tests more robust (cloudflare#9494)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run wrangler + vite-plugin e2e tests on a PR skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants