-
Notifications
You must be signed in to change notification settings - Fork 721
Add parallel removal of items #3008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
90c02f3
Add parallel removal of items
mimischi ac5fe9f
Format files
mimischi 4db67c0
Simplify structure by relying on dfs
mimischi 09d11a9
Add documentation to new code and rename functions
mimischi 861c188
Attempt not to break API
mimischi 1d60824
Fix documentation check, and some indents
mimischi a97776b
Refactor for a cleaner structure
mimischi 1a2f27e
Add `TokenBucket` adaptation from SwiftPM
mimischi 2a1d510
Add `maxDescriptors` to `RemovalStrategy.swift`
mimischi 5d7a178
Update tests
mimischi 7a91ae6
Update `ParallelRemoval` to use `TokenBucket`
mimischi 1b010e5
Add `FileSystemProtocol` method to not break API
mimischi b336a44
Actually stop breaking the API
mimischi 0a83116
Format file
mimischi 4390a8e
Refactor IO strategies to share commonalities
mimischi f00e17a
Fix typo in comment on function signature
mimischi 1e4d5b5
Address reviews for `TokenBucket.swift`
mimischi dbd3ded
Address `ParallelRemoval.swift` review comments
mimischi 5b536ca
Address `IOStrategy.swift` reviews
mimischi 3d990b1
Remove unnecessary implementations
mimischi 9146b91
Remove new arguments to tests function calls
mimischi 338ff35
Re-use directory discovery logic
mimischi 7ed6d7d
Makr `TokenBucket` as `@unchecked Sendable`
mimischi e9df08e
Revert "Re-use directory discovery logic"
mimischi e98388f
Merge branch 'main' into parallel-removal
glbrntt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add labels to the tuples? It's too easy to mix them up otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, do we even need to split them? We could just return the directory entries and the caller can then iterate over them and do as they need. This would avoid allocating an array unnecessarily as well (not that I think it'll have any meaningful impact on perf).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can get behind adding labels. If we only return a single array, then the callers would need to perform the sorting themselves, and thus replicate the bulk of what this utility does. I'm not wed to this existing, but I think if we have it then might as well use it to remove some level of duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a quick discussion offline. Reverted the addition of
_collectItemsInDirectoryin e9df08e