Repository navigation
perf(ui-egui): make a printout in the background - #393
Open
leifrossau wants to merge 5 commits into
Open
leifrossau wants to merge 5 commits into
leifrossau wants to merge 5 commits into
Conversation
A printout's pages were rendered one after another: a fifteen-page PDF took 1.9 s in a release build. They are now rendered on one thread per core (up to eight), each with its own reading of the document, and still come out in the document's order: 0.42 s on eight cores. The renderer also reports how many pages are done, for a progress note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inserting a printout rendered its pages, attached the document and copied every page into the page's folder on the window's thread, and the page froze until all of it was done: about three seconds for fifteen pages on a OneDrive (onedriver) mount, more for an Office document, which is converted first. It is now made off the window's thread (`printout::Job`). The page goes on being written in, the status line says how many pages are done, and the printout goes in once it is ready: where the writer is, as before, or, when another page was opened meanwhile, into the page it was asked for, in a box of its own below what is there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
Inserting a printout froze the page for seconds: every page was rendered and copied into the page's folder on the window's thread. It is now made off the window's thread (
printout::Job), its pages rendered in parallel, with progress in the status line, and the pages go in once ready: into the open page where the writer is, or, if another page was opened meanwhile, into that page's file in a box of its own. On a 15-page PDF, 1.9 s down to 0.42 s, and the window keeps drawing throughout.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.a_printout_is_made_in_the_background_and_goes_in_when_ready,a_printout_goes_into_its_own_page_when_another_was_opened_meanwhile; the existing printout tests pass through the background path.🤖 Generated with Claude Code