Skip to content

perf(client): use a Set for renewed module ids in logUpdates - #2375

Merged
bjohansebas merged 1 commit into
hot-e2e-testsfrom
hot-client-perf
Jul 29, 2026
Merged

perf(client): use a Set for renewed module ids in logUpdates#2375
bjohansebas merged 1 commit into
hot-e2e-testsfrom
hot-client-perf

Conversation

@bjohansebas

@bjohansebas bjohansebas commented Jul 29, 2026

Copy link
Copy Markdown
Member

Replaces Array#includes inside the filter over updated modules (O(n·m) → O(n+m)) — noticeable on updates touching hundreds of modules.

Summary

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI


Note

Low Risk
Behavior-preserving micro-optimization in client HMR logging only; no auth, data, or API surface changes.

Overview
Hot-module-replacement logging now builds a Set from successfully renewed module ids before filtering which updated modules were not accepted, instead of calling Array#includes on every id in the filter.

That changes logUpdates from roughly O(n·m) to O(n+m) when comparing attempted vs renewed modules—mainly helpful when an update touches hundreds of modules, with the same warnings and reload behavior as before.

Reviewed by Cursor Bugbot for commit 903995f. Bugbot is set up for automated code reviews on this repo. Configure here.

Replaces Array#includes inside the filter over updated modules
(O(n·m) → O(n+m)) — noticeable on updates touching hundreds of modules.
@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 903995f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@bjohansebas
bjohansebas merged commit 37cc3ff into hot-e2e-tests Jul 29, 2026
4 checks passed
@bjohansebas
bjohansebas deleted the hot-client-perf branch July 29, 2026 16:15
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.

1 participant