Repository navigation
Speed up Writer outline search and draft checkpointing, and explain save and export failures - #253
Open
callumalpass wants to merge 2 commits into
Open
callumalpass wants to merge 2 commits into
callumalpass wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Refs #113
Writer now reuses the manuscript reading order until its inputs change. Chapter rows retain a stable fold handler when the active chapter changes. Plain paragraphs skip unnecessary decoration work, footnote lookups run on demand, and counting words avoids allocating an array of every word. The Sources panel reuses its keyboard-navigation list across unrelated renders.
I found raw fallback messages in save and export failures, including worker exceptions and Pandoc warning types. Writer now presents recovery text, keeps typed save codes in collapsed technical details, and offers retry after export failure. Image reads that encounter the same pagination failure as the index now return the same user-facing message. Regression coverage checks the exact local draft, an eventual confirmed save, retry to a downloaded ZIP, and both callers of the failed index read.
Measurements
All values are milliseconds. The browser ran Chromium 155.0.8059.84 on a four-vCPU AMD EPYC 9B14 GCP desktop. Each size used seven alternating baseline/candidate pairs with a fresh context per sample. Browser p95 is nearest-rank, which is the maximum of seven. Baseline was
5b22cbf; interactive runs used the performance changes inab220ef. The final commit changes an index error path and its regression test.In the 120-chapter SDK fixture, Writer discovers all chapters and 5,000 sources. The pinned SDK accepts the main record and 63 chapter sessions and refuses 57. The browser waits for all 120 outcomes, searches loaded text, checks the 100-reference preview, and verifies the exact 22-character edit in both local storage and the confirmed SDK body. Hydration includes navigation, DEV module loading and fixture seeding. The bibliography column includes preview rendering. The separate mounted React test reads all 120 chapter bodies.
In the large browser case, outline search and typing through the draft checkpoint improved. Chapter switching took longer in both browser sizes with 5,000 sources even though the isolated React switch became cheaper. Hydration was effectively flat. The small control also took longer to filter and checkpoint. The 60-chapter table records the earlier fully loaded comparison before the session-budget message was added.
Mounted 120-chapter outline, 5,000 source keys (ms)
120 chapters requested, 5,000 sources (ms)
Small control, two chapters and nine sources (ms)
Fully loaded 60 chapters and 5,000 sources, initial comparison (ms)
Reproduce
From the candidate checkout, prepare the baseline and give it the identical fixture and measurement scripts.
Start the two servers in separate shells, then run the browser profile from the candidate checkout.
Use
PROFILE_CHAPTERS=60for the fully loaded comparison. SetCHROMEto select a Chromium executable. For the mounted outline, run the command below in each checkout seven times, alternating the starting revision. Initial render uses one timing per process. The other mounted rows show the median of seven within-process p50s and p95s, each computed after five warm-ups on twenty measured updates.Verification
rpnpm check,rpnpm build:production, andrpnpm --filter @mdbase-writer/app typecheck:perfpassed atfa77818. Chromium reliability passed all 25 scenarios on the preceding commit. The final Chromium polish and reliability runs are in progress.