Repository navigation
Conversation
xcv58
marked this pull request as ready for review
October 7, 2026 02:24
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.
Problem and result
Folders with many small files make storage and cleanup scans spend substantial time on per-entry metadata queries and temporary objects. Stream bounded metadata batches in Storage Explorer, reuse bulk metadata sizing in Xcode Clean, and use bulk discovery in Disk Clean to reduce scan time and wide-folder memory use.
Changes
FileSystemDirectoryReader.readBatcheswhile retaining the collecting API. Unsupported bulk reads fall back before delivery; later errors propagate without restarting enumeration or duplicating earlier batches.User-visible behavior and scope
No UI layout, copy, settings, or scan-trigger changes. Filesystem scans remain off the main thread, with progress and results delivered through the existing controllers. Cleanup categories, default selections, permission requirements, allowlists, and pre-removal validation are unchanged.
Users may see faster completion and earlier progress updates. This also includes limited changes to scan results and error handling:
Verification
make ci: 228 script tests and 2,706 XCTest tests passed (four opt-in Window Switcher UI tests skipped); PluginKit v7 binary compatibility client passed.git diff --checkpassed.Recorded Release Swift 6 benchmarks on local APFS against baseline
d914bfbe, with five measured samples per variant after warmup:Storage Explorer's peak RSS for the wide fixture fell from 161.0 to 32.9 MiB. Its benchmark used six workers, progress-only snapshots and a 10,000-file retention limit. File totals, retention bounds and per-directory largest-file sizes matched; Disk Clean candidate fields matched. These are synthetic metadata scans of empty or sparse files with warm caches; they do not measure payload throughput or production UI latency. Raw samples and source snapshots remain in ignored local benchmark artifacts.
UI evidence
No UI layout or copy changes. A manual UI smoke test was not performed. Cleanup execution was not exercised against user files; validation used temporary directories and fake stores.
Checklist