Repository navigation
fix(solid): rename and remove an instance's registrations in one edit - #497
Merged
Merged
Conversation
Renaming or deleting an instance changed its registrations in a type index one at a time, each with a setThing or removeThing on the whole dataset, which copies the document and its changes so far. An index with many registrations of the instance took time that grows with their square, for each of the two indexes. The registrations to retitle, to trim and to remove are now gathered first and applied with one setThings and one removeThings call. Growth tests pin both to linear time. Nothing but tests used removeThing any more, so both clients drop it, and its tests now use removeThings. Refs: GHSA-ww22-r24g-g5h7
ixuz
force-pushed
the
fix/type-index-one-edit
branch
from
November 2, 2026 10:24
5450d6a to
4d83d4f
Compare
ixuz
enabled auto-merge
November 2, 2026 10:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Renaming or deleting an instance used to change its registrations in a type index one at a time. Each change was a
setThingorremoveThingon the whole dataset, and each of those copies the document along with the changes made so far. So when an index held many registrations of the instance, the work grew with the square of their number, and that happened for both indexes.The registrations to retitle, trim or remove are now gathered first and then applied with one
setThingscall and oneremoveThingscall. New growth tests (packages/solid/src/typeIndex.growth.test.ts) holdrenameInstanceRegistrationsandremoveInstanceRegistrationsto linear time. After this change only tests usedremoveThing, so both clients (packages/solidandpackages/solid-memo-client) drop it, and its tests now useremoveThings.docs/style.mdand the growth-test list indocs/testing.mdare updated to match.What the app writes to a pod does not change. Only the number of edits it takes to get there does.
For reviewers: this branch,
fix/draft-listing-indexandfix/graph-address-boundall change the same line ofdocs/testing.mdand conflict there. Please merge them one at a time and rebase the rest after each merge.Refs: GHSA-ww22-r24g-g5h7
Checklist
Refs:)Refs:, notCloses:. Leave this unchecked otherwise.npm run checkpasses (lint, Markdown and spelling included),npm run lint:reusetoo if a file was added, andnpm run crosschecktoo ifns/ordecks/changed. (crosscheckn/a: neitherns/nordecks/changed)docs/is listed in docs/docs.ttl. (no new page)packages/ui/src/i18n/). (n/a: no message changed)ns/was agreed in an issue first; no publishedns/shapes/*/vN.ttlordecks/*/vN.ttlwas edited; generated files were regenerated, not edited. (n/a:ns/anddecks/are unchanged)!and aBREAKING CHANGE:footer).npm run check:breakingsees a line ofapi/that goes, but not a feature removed, nor a reader that reads less than before.npm run lint:reuse), or a new deck its line inREUSE.toml; third-party content is credited.npm run dev) and tried the change, and considered the user journeys.type(scope): subject,!and aBREAKING CHANGE:footer if it breaks something), with an imperative subject and a body that explains why (CONTRIBUTING.md).