Optimize scan performance and add Smart Shredder#14
Merged
Conversation
Dezoff-max
marked this pull request as ready for review
July 13, 2026 02:25
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.
What changed
Why
The scan progress UI continuously invalidated SwiftUI layout and sustained high CPU usage, which heated the Mac. The user also requested an isolated hacker-style tool for intentional irreversible file deletion.
Impact
The repeated Home Disk Analysis benchmark dropped from a 111–124% CPU baseline to 28.6% at startup, then 1.5% and idle-level samples while analysis remained active. Normal cleanup, duplicate removal, and application removal remain Trash-based. Smart Shredder is isolated from scans, scheduling, cleanup history, Trash, and restore.
Smart Shredder performs best-effort overwrite and direct unlink. It rejects directories, symlinks, hard links, package contents, protected roots, and files changed after review. The UI explicitly states that physical erasure cannot be guaranteed on SSD/APFS.
Validation
swift test --package-path CleanMacCore— 47/47 passedSecureFileShredderTests— 4/4 passedxcodebuild— passed./script/build_and_run.sh --verify— build, ad-hoc signature, and launch passedgit diff --check— passedNo real user file was deleted during verification.