Skip to content

perf(browser): keep large mixed-type grouped listings responsive - #1928

Merged
l0gicgate merged 6 commits into
mainfrom
fix/1913-mixed-type-investigation
Nov 1, 2026
Merged

l0gicgate merged 6 commits into
mainfrom
fix/1913-mixed-type-investigation

Conversation

@JoeJoeflyn

Copy link
Copy Markdown
Collaborator

Description

Remove repeated large-range regrouping/reindexing when mixed file types arrive in List view. A stable type-bucket projection reuses the existing comparator and filter, preserves item identity and section headings, and keeps small selection lookups from rebuilding the whole index. Extend existing hidden-file coverage and wait for initial window painting before two renderer-sensitive tests begin their timed interactions.

On a synthetic 100k mixed-extension folder containing 10k hidden files, the optimized QA-enabled build measured 1,968 ms median with hidden files off (90k visible), and 1,617 ms with them on (100k visible), across three runs each; application RSS/peak was 210–213 MiB. These measure full publication, not first paint, and do not reproduce the issue's full-sized media contents. The sub-second target is not achieved by this patch; the temporary background-preparation/notification-batching experiment is not included.

Visual evidence

N/A — existing presentation is preserved; this changes model publication and indexing.

How to test

  1. Open the large mixed-type fixtures from the issue in List view with Group by file type enabled.
  2. During loading, select a file; change sorting, filtering, grouping and Show hidden files. Rename a file across extensions, then delete it and verify that a same-stem neighbor is untouched.
  3. Check image previews, then navigate away during a load and open an empty directory.

Expected result: Loading completes without repeated whole-list stalls; grouping and hidden-file visibility remain correct, actions target the chosen file, previews appear, and no stale rows survive navigation.

Related issue

Closes #1913

Defer broad view-index replacements until lookup while preserving incremental appends and generation-aware source mappings. Cover staged selection, sorting, hidden rows, regrouping, teardown and file actions.\n\nRefs #1913
The full Rust run exposed an asynchronous readiness race after handing a video to its external player. Wait for the stream rather than assuming that preview focus implies it is initialized.
Reuse the existing type comparator and source-index mapping while preserving item identity across mixed-type arrival batches. Cover live hidden-file preferences in grouped List view.

Refs #1913
Share window readiness between progress-notification and format-dialog fixtures so renderer startup does not consume their interaction deadlines.
@JoeJoeflyn

Copy link
Copy Markdown
Collaborator Author

Validation and benchmark handoff:

  • ./scripts/quality.sh fmt — passed.
  • ./scripts/quality.sh clippy — passed.
  • ./scripts/qa.sh — 631 passed, including grouped file targeting and hidden-file persistence in grouped List view.
  • STRATA_QUALITY_TASK=build ./scripts/quality.sh test — pinned test-binary build passed. Ran the built binary in private Xvfb/private D-Bus with ui::browser_modes::, ui::progress_dock::tests::, ui::window::drive_dialogs::tests::, grouped_publication_keeps_targets_across_listing_changes, and ui::window::tests::keyboard_dispatch::video_clips::: 35 passed with the default renderer.

The earlier full ./scripts/quality.sh test run recorded 3,650 passed, 2 failed, 11 ignored. Both failures reproduced in isolation in the pinned image with its default renderer (but not Cairo). Commit b052378 fixes their setup by awaiting the first window frame before timed interactions. The exact two failures and their affected owning modules now pass. Per scoped-rerun policy, the entire Rust suite was not repeated after those test-only setup fixes; CI remains the authoritative full rerun.

Scope: the projection and shared source-index map affect selection, filtering, navigation and file-action targeting, so existing broad Rust results were retained, caller regressions rerun, and the final full QA suite executed. No new performance-only smoke launches or duplicate sorting/filtering rules were added.

The production benchmark used the existing optimized QA-enabled binary (opt-level 3, LTO off), whose production logic matches this patch; subsequent changes were test readiness and whitespace only. On the synthetic 100k eight-byte mixed-extension files, 10k hidden, three fresh-process runs per setting:

Show hidden Full-publication runs (ms) Median (ms) Verified view rows
Off 1967.9 / 1832.9 / 2122.0 1967.9 90,000
On 1574.2 / 1617.4 / 1635.2 1617.4 100,000

Application RSS/observed peak: 210–213 MiB. This is full publication after terminal handlers, not first paint. The original 638 MB text / 8.8 GB image fixtures were not regenerated for the final projection benchmark. The temporary sub-second MIME-preparation/notification-batching shim is diagnostic only and is not shipped in this PR; production sub-second loading remains unachieved.

The owner's latest request explicitly authorized committing, pushing and opening this PR after the earlier uncommitted-work hold. No validation or GUI-isolation requirement was waived.

@JoeJoeflyn

Copy link
Copy Markdown
Collaborator Author

CI status: the dependency/spelling job is blocked by RUSTSEC-2026-0414 in the existing pulldown-cmark 0.13.4 lockfile entry (fixed upstream in 0.13.5). This PR changes neither Cargo.toml nor Cargo.lock; I have not suppressed the advisory or expanded the performance fix into a dependency upgrade. Local formatting, Clippy, affected Rust regressions and all 631 QA runs passed as recorded above. Other CI jobs are still running.

@JoeJoeflyn
JoeJoeflyn marked this pull request as draft October 28, 2026 19:21
…review

# Conflicts:
#	tests/qa/scenarios/hidden_files/hidden-files-persist-across-restart.jsonl
The grouped-list scenario waited for focus on the renamed row, but QA
state only covers rendered rows and the renamed file lands offscreen in
its new group; main behaves the same with the sort list model. Wait for
the old row to leave the CSV group instead. Drop the duplicate 512-row
pass from the eager-read regression, whose bound already scales with the
row count.
@l0gicgate

Copy link
Copy Markdown
Contributor

Review pass:

  • Merged main at 64a90b9 with a merge commit (9cad290). The only conflict was the header of hidden-files-persist-across-restart.jsonl: kept main's new icons mode and costs together with this PR's group_by_type preference. Main's lockfile already carries pulldown-cmark 0.13.5, so the advisory that failed the earlier dependency job is gone.
  • grouped-list-keeps-file-targets failed at "focus follows the file into its new group" in the pinned container, deterministically, on the PR head before the merge, on the merge, and on plain main with the same scenario file. The QA snapshot only reads rendered rows, and the renamed file lands offscreen in the JSON group, so focused and selected read null there; the rename reveal does not scroll to a row that moved to another type group on main either. That is pre-existing and outside this PR, so the step now waits for the old row to leave the CSV group instead (7efa04a). The remaining steps (filter results, F2 target, Delete target, trash contents) still prove the model tracks the renamed file.
  • Dropped the duplicate 512-row pass from chunked_type_groups_do_not_eagerly_read_replaced_ranges; its read bound already scales with the row count, so the second size exercised nothing new.
  • Read the GroupedModel emissions, re-entrancy, group ordering under non-append inserts and removals, and the lazy SourceIndexMap against the old sort-model behaviour; no defect found. Two known limits are unchanged from main: incremental inserts compare under the current preferences while TypeGroupSorter::refresh can skip the re-sort, and only StringObject rows are grouped.

Verification: ui::browser_modes::, reload_cursor::, progress_dock::tests::, drive_dialogs::tests::, video_clips::, and app::browser::publication headless (51 passed); ./scripts/qa.sh grouped-list-keeps-file-targets hidden-files-persist-across-restart (4 runs passed after the scenario fix); fmt, clippy -D warnings, git diff --check. Dispatched CI for the draft: https://github.com/lgse/strata/actions/runs/41239143427 (all jobs green, including QA scenarios).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(browser): List view with Group by file type is slow and fails to load files or previews in very large folders

2 participants