Skip to content

Charts and scrollbars stay responsive while browsing after a scan - #42

Merged
JE-Chen merged 4 commits into
mainfrom
dev
Nov 19, 2026
Merged

JE-Chen merged 4 commits into
mainfrom
dev

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Releases what dev has added since 0.2.14: browsing the charts after a scan no longer stalls.

Charts stay responsive under the mouse (U-20261119-04)

  • The bar chart asked the style for the folder icon on every folder line of every repaint. On Windows each call took 41–52 ms and is not cached, so a folder full of subfolders took seconds per repaint. It is now asked once, and again only after a style change.
  • All four charts showed a tooltip on every hover change, which cost 35–45 ms per call. They now answer Qt's tooltip event, once the mouse rests, and the tooltip hides when the mouse leaves that bar or tile.
  • The bar chart draws only the lines on screen. A hover or selection change repaints only the lines it changes.
  • Selecting an entry already shown in a paged tree folder no longer searches the rest of that folder.

No freeze when the clean-up suggestions arrive (U-20261119-05)

  • Qt lays out every line of an opened group even while its tab is hidden. On C:\Windows, 56,321 empty folders held the GUI thread for 0.6–0.7 s a few seconds after the scan ended.
  • The clean-up list now opens its groups when the tab is first shown. The duplicates list is unchanged.

Scrollbars no longer stall while the clean-up worker runs (U-20261119-06)

  • After a scan, the empty-folder search's emptiness pass and outermost() ran over every folder without giving way, about 0.3 s on C:\Windows. Every call the window made into Python waited for the worker, so the folder tree stalled 381 ms while its scrollbar was dragged.
  • Both passes now check the pacing gate every 256 entries. In two runs, the worst step after a scan was 98–104 ms.
  • On 0.2.14, dragging the bar chart's scrollbar at the C:\Windows root took 3.1–4.4 s per step, without opening any folder; now the worst step is 53–65 ms. That was the folder icon problem above.

Large folders give way a page at a time (U-20261119-07)

  • The scan's add-up and sort, and the clean-up rule matching, gave way once per folder. One folder of 41,610 entries took 42 ms to add up and sort and 100 ms to match, so the tree's scrollbar still stalled 104–155 ms now and then.
  • Folders of more than 256 entries are now handled a page at a time, giving way between pages, in the same stable order as before. Over 172,164 folders, _add_up takes 47–67 ms more (about 0.5% of the scan).
  • Three runs dragging the tree's scrollbar through a scan and after it: no step over 100 ms.

Measured on the same machine in a hidden window. The browsing figures are from a scan of C:\Windows (WinSxS, 29,244 entries):

Action 0.2.14 Now
Open WinSxS in the bar chart 5.2 s 33–38 ms
Move the mouse 30 times there 180 s 23–28 ms
Click 5 bars 28 s 61–62 ms
Scroll 57 s 38–47 ms
Longest stall in the 8 s after a scan 0.66 s (3.7 s in 0.2.14) 0.06 s

Visible differences:

  • Chart tooltips appear after Qt's usual short pause instead of on every move.
  • Opening the Clean-up tab for the first time after a scan takes the layout time instead (612 ms on C:\Windows).

Not verified

  • Measured in a hidden window, not on the reporter's own screen or drive.
  • A drive with more empty folders waits longer when the Clean-up tab is first opened.

Test plan

  • ruff check .
  • New test_chart_hover.py (9 cases) and test_grouped_list_deferred.py (4 cases), plus one new paging case. Without the fixes, 6 of the chart cases fail, as does the paging case.
  • Related tests locally: charts, tree, GUI, clean-up, grouped lists, duplicates and copy (the known long-path test excluded)
  • Seven new pacing cases in test_pacing.py; the paced cases fail without their fixes
  • Tests workflow on dev for every commit

Chart tooltips now wait for Qt's tooltip event instead of a showText call
per hover change (35-45 ms each). The bar chart paints only the exposed
lines, repaints just the lines a hover or selection changes, and asks the
style for its folder icon once (41-52 ms per call on Windows). Selecting an
entry already on a tree page no longer searches the rest of its folder.
Qt lays out every line of an opened group even while its tab is hidden.
When the clean-up suggestions arrived after a scan, 56,321 empty folders
held the GUI thread for 0.6-0.7 s while the charts were in use. A marked
grouped list filled while hidden now opens its groups when it is next
shown; the wait moves to the first visit of the Clean-up tab.
After a scan, the clean-up worker's emptiness pass and outermost() ran
over every folder without giving way: 0.3 s on C:\Windows during which
each call the window made into Python waited for the worker, and the
folder tree stalled 381 ms while its scrollbar was dragged. Both passes
now check the pacing gate every 256 entries.
The scan's add-up and sort and the clean-up rule matching gave way once
per folder; one folder of 41,610 entries took 42 ms to add up and sort
and 100 ms to match, and dragging the folder tree's scrollbar still
stalled 104-155 ms now and then. Folders of more than 256 entries are
now handled a page at a time, giving way between pages, with the same
stable order as before.
@sonarqubecloud

Copy link
Copy Markdown

@JE-Chen
JE-Chen merged commit 428dbb7 into main Nov 19, 2026
98 of 103 checks passed

This branch was previously deployed

1 inactive deployment
windows-signing — 52a18b5d Deployed Nov 19, 2026 by JE-Chen via build-exe #17
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.

1 participant