Skip to content

perf(ui-egui): make a printout in the background - #393

Open
leifrossau wants to merge 5 commits into
AlienTechSoftware:mainfrom
leifrossau:perf/printout-background
Open

leifrossau wants to merge 5 commits into
AlienTechSoftware:mainfrom
leifrossau:perf/printout-background

Conversation

@leifrossau

Copy link
Copy Markdown
Collaborator

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-push passes on the current branch before pushing
  • The pre-push hook confirms the validation still matches origin/main
  • CI checks pass for this pull request
  • Coverage: the coverage job's warnings are read; cargo xtask coverage --update is in
    this pull request if coverage rose
  • Docs match the change: no command, control-protocol or gap changes
  • A new user action is a CommandSpec with a test (no new user action)
  • Page or demo changes: none
  • UI changes: no visual change
  • New files under assets/ or docs/images/ have a row in ATTRIBUTION.md (none added)

How it was checked

  • cargo xtask pre-push on this branch.
  • Tests 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

leifrossau and others added 5 commits November 18, 2026 20:03
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants