Skip to content

[Finder] [Finder docs] Add early directory prunning filter support #18499

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 1 commit into from
Oct 16, 2023

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jul 5, 2023

@carsonbot carsonbot added this to the 6.4 milestone Jul 5, 2023
@mvorisek mvorisek force-pushed the debug_is_dir_cache_from_readdir branch 2 times, most recently from e3932d3 to 90e73a1 Compare July 5, 2023 00:24
@javiereguiluz javiereguiluz added the Waiting Code Merge Docs for features pending to be merged label Jul 5, 2023
@carsonbot carsonbot modified the milestones: 6.4, next Jul 5, 2023
@mvorisek mvorisek force-pushed the debug_is_dir_cache_from_readdir branch from 8d46e70 to 7c0c6c1 Compare July 5, 2023 07:01
@mvorisek mvorisek force-pushed the debug_is_dir_cache_from_readdir branch from 7c731f6 to 7f1bbea Compare July 12, 2023 19:43
@mvorisek mvorisek force-pushed the debug_is_dir_cache_from_readdir branch from 7f1bbea to 4b08ee6 Compare July 12, 2023 19:44
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Oct 11, 2023
…mvorisek)

This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[Finder] Add early directory prunning filter support

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#18499

Filtering terminology first:

- "exclude" - whole filesystem subtree is traversed, directories (and files) are excluded after, slow
- "prune" - pruned directories are not traversed, fast

Currently there is early directory prunning support possible, but with string patterns only, not even full regex is supported as the input is always quoted - https://github.com/symfony/symfony/blob/v6.2.12/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php#L45.

This PR adds early directory prunning with full callback support.

Tested with VFS to assert the pruned directories are really not traversed and the count of IO syscalls is minimal.

Commits
-------

840cb28 [Finder] Add early directory prunning filter support
@javiereguiluz javiereguiluz added Finder and removed Waiting Code Merge Docs for features pending to be merged labels Oct 16, 2023
@carsonbot carsonbot changed the title [Finder docs] Add early directory prunning filter support [Finder] [Finder docs] Add early directory prunning filter support Oct 16, 2023
@javiereguiluz javiereguiluz merged commit f87c9e6 into symfony:6.4 Oct 16, 2023
@javiereguiluz
Copy link
Member

Michael, thanks for implementing this feature and providing the docs for it. Congrats also on your first Symfony Docs contribution 🎉

@mvorisek mvorisek deleted the debug_is_dir_cache_from_readdir branch October 16, 2023 11:45
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.

4 participants