Repository navigation
Speed up Writer manuscript hydration and chapter switching - #255
Merged
Merged
Conversation
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.
Changes
Chromium comparison
The baseline CPU capture spent about 2.3 seconds under the in-memory SDK's contract projection handler during large-fixture hydration. The switch trace also showed React work in the workspace and outline.
Seven alternating baseline and candidate pairs at each fixture size, against
e56c6980a0f0f2b9b4b9178ded4519902d389775. Chromium 149.0.7827.55, Node 22.22.0 and the pinned production SDK 0.2.61, using local Vite development servers and in-memory demo collections. The large fixture has 120 chapter references, 5,000 sources and 30,000 annotations. Hydration includes navigation, fixture seeding, index and outline readiness, and settling every chapter open. The SDK permits 64 record sessions in this fixture. The main record and 63 chapters open, and Writer reports 57 refused opens on both revisions.Values are baseline → candidate. The nearest-rank p95 is the maximum of seven observations. Large hydration improved in all seven pairs and switching in five. The large switch, completion and checkpoint p95 rose. The two-chapter source filter was slower in all seven primary pairs. A separate seven-pair probe showed mixed results and a +0.4 ms median paired end-to-end difference. The input-to-result DOM median in that probe was 34.5 → 48.6 ms.
Reproduce
Start each server in its own checkout with dependencies installed from the lockfile. Use the benchmark driver in the candidate checkout.
See the performance README for the fixture assertions and optional CPU capture.
Verification
rpnpm checkrpnpm build:productionrpnpm --filter @mdbase-writer/app typecheck:perf