perf(storage): speed up cleanup checks and show file progress #320

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:perf/cleanup-file-checks into main 2026-11-27 22:30:23 +00:00
Owner

Cleaning a large extracted RomFS can leave the dialog at 0% while the launcher checks the files again. The scan repeated the same ancestor and metadata lookups for every file, and the percentage hid the first deletions.

The scanner now verifies each directory, reads the metadata from each entry, and checks the directory again after enumeration. The existing cleanup plan comparison, file identity and hard-link checks, and final checks before deletion still apply. The dialog shows Checking files… with an animated bar during verification and Removed X of Y files once removal begins. It reports the first removal immediately and limits intermediate updates to ten per second.

Measurements and verification

  • On Linux, three warm-cache runs over the same 20,000 synthetic files measured 408–410 ms for the previous per-file checks and 65–69 ms for the directory-based traversal. All three pairs produced identical file records. These timings cover generated-file traversal only.
  • Exercised the native launcher on a private display with a synthetic previous installation. The dialog displayed the checking phase, then increasing counts out of 20,000, and finished with zero fixture files remaining.
  • Added assertions for the full sequence of removal counts and for preservation of external files reached by links in the generated tree.
Cleaning a large extracted RomFS can leave the dialog at 0% while the launcher checks the files again. The scan repeated the same ancestor and metadata lookups for every file, and the percentage hid the first deletions. The scanner now verifies each directory, reads the metadata from each entry, and checks the directory again after enumeration. The existing cleanup plan comparison, file identity and hard-link checks, and final checks before deletion still apply. The dialog shows **Checking files…** with an animated bar during verification and **Removed X of Y files** once removal begins. It reports the first removal immediately and limits intermediate updates to ten per second. ### Measurements and verification - On Linux, three warm-cache runs over the same 20,000 synthetic files measured 408–410 ms for the previous per-file checks and 65–69 ms for the directory-based traversal. All three pairs produced identical file records. These timings cover generated-file traversal only. - Exercised the native launcher on a private display with a synthetic previous installation. The dialog displayed the checking phase, then increasing counts out of 20,000, and finished with zero fixture files remaining. - Added assertions for the full sequence of removal counts and for preservation of external files reached by links in the generated tree.
perf(storage): speed up cleanup checks and show file progress
Some checks failed
CI / What the change needs (pull_request) Successful in 5s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 9s
PR title / Conventional Commit title (pull_request) Successful in 4s
CI / Rust formatting, lint and tests (pull_request) Successful in 8m26s
CI / Release packages and stable upgrades (pull_request) Failing after 1h0m5s
c79159c505
Assisted-by: OpenAI Codex
Co-Authored-By: OpenAI Codex <[email protected]>
Author
Owner

Checking files

Removed files

![Checking files](https://git.magicbean.dev/attachments/2eb2b7ce-b683-4e1c-ac0e-04c6548373ba) ![Removed files](https://git.magicbean.dev/attachments/6627153a-ffb5-45af-9d69-18340db1f2b9)
HumanBean changed title from WIP: perf(storage): speed up cleanup checks and show file progress to perf(storage): speed up cleanup checks and show file progress 2026-11-27 22:29:07 +00:00
HumanBean deleted branch perf/cleanup-file-checks 2026-11-27 22:30:24 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!320
No description provided.