Repository navigation
perf(ui-egui): stop reading the disk on every frame - #386
Merged
DWAA1660 merged 7 commits intoNov 18, 2026
Merged
Conversation
Drawing a page asked about its files every frame: two lookups per picture, attachment and icon checks, a read of the page for the ribbon's shortcuts, a read of every page in the section for Make Subpage, the page's ancestors for the New section button, and three checks a frame for another window's writes. On a local disk that is a few milliseconds; on a FUSE mount such as OneDrive through onedriver every open waits on the mount, and a page of printouts drew a few frames a second. File answers are now kept for two seconds (fscache) and let go after any command or page open; the shortcuts read the disk only when a key goes down; New section uses the tree in memory; the other-window check runs twice a second and before any key, text or click. Measured on a page of 43 printouts: 13,860 lookups and 1,140 opens a second down to about 110 and 60, none of them on the notebook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The web build (Build website WASM) failed: preview.rs takes `std` from the web shim, so its SystemTime is web-time's, while fscache.rs used the real one, and asked the real disk, which the browser has none of. fscache.rs now gets the same one-line rule as preview.rs in patches.yaml, and its modification time comes from a function that is None on wasm (the shim's Metadata has none).
fscache.rs asks std::fs::metadata for the pictures preview.rs draws. In the browser it now asks the in-memory notebook and uses the same web-time SystemTime as preview.rs, which fixes the Build website WASM type errors.
DWAA1660
enabled auto-merge
November 18, 2026 22:10
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
Drawing a page asked the disk about its files on every frame: two lookups per picture (
image_bytes), the attachment and icon checks (first_missing_attachment_in_source),object_linkper picture, a read of the selected page for the ribbon's shortcuts (hierarchy_keys), a read of every page in the section for Make Subpage (can_make_subpage), the page's ancestors for the New section button (new_section_parent), and up to three other-window change checks a frame. On a local disk that costs a few milliseconds. On a FUSE mount (OneDrive through onedriver) every open waits on the mount's process: on a page of 43 printouts frames took 40 to 170 ms and zoom and pan were choppy.fscache.rskeeps file answers for two seconds and lets them go after any engine command, a page open or a finished printout.Measured on the 43-printout page in a real window: 13,860 lookups and 1,140 opens a second down to about 110 and 60 (the last being
settings.toml), none on the notebook; frames about 3 ms.Quality level L3 (see SKILLS/nc-devx/SKILL.md)
cargo xtask pre-pushpasses on the current branch before pushingorigin/maincoveragejob's warnings are read;cargo xtask coverage --updateis inthis pull request if coverage rose
CommandSpecwith a test (no new user action)assets/ordocs/images/have a row inATTRIBUTION.md(none added)How it was checked
cargo xtask pre-pushon this branch.drawing_a_page_of_printouts_does_not_ask_the_disk_every_frameandfscacheunit tests;a_changed_picture_is_read_again_under_a_new_namestill passes (a command lets the cache go).LD_PRELOADcounter on a real window before and after; frame times from the same run. Not checked: Windows and macOS, where the cache only removes work.🤖 Generated with Claude Code