perf: avoid unnecessary work in file dependency checks - #60
Open
TristanKruse wants to merge 6 commits into
Open
TristanKruse wants to merge 6 commits into
TristanKruse wants to merge 6 commits into
Conversation
This was referenced Sep 25, 2026
This was referenced Sep 27, 2026
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.
Summary
Speed up direct file-dependency checks without changing their results:
search(), avoid matching a redundant leading*prefix. The original compiled regex remains available onFilter.regexp; only the internal search path uses the equivalent faster form. Custom compiled regexes are unchanged..pyfilename; directory pruning, custom file exclusions, and.archignorestill apply.Refs #58 and #59. The reusable benchmark work remains tracked in #55.
Verification
On a generated project with four areas and a direct
api→infrastructureprohibition, I alternated clean 1.7.0 and commit2f7efbfin eight fresh-process pairs per size. Both versions passed the clean, seeded forbidden-import, and cycle correctness gates before timing:2f7efbfmedianThe final exclusion change was then measured independently against
2f7efbf, again in eight fresh-process pairs with the same correctness gates:2f7efbfmedianThese are local Windows 11 / Python 3.13.4 results for one synthetic direct-boundary rule, not a universal ranking. At 5,000 leaf modules, selective extraction parses 1,251 of the 5,005 project files. The two tables are separate paired experiments; their absolute times should not be combined across runs.
.archignore, cache invalidation, and preservation of glob search andFilteridentity semantics.Change Type