-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Allow skipping validation when Match
ing
#92
Comments
I've been having the same performance concerns for a while, also from a bazel gazelle extension where the same globs are invoked a significant number of times. |
Sorry I haven't replied to this in so long - life is busy 😢 So, the Lines 286 to 288 in 424062b
That's the only case I cut a v4.7.0 which includes a |
doublestar now has an option to match without re-validating every time, see bmatcuk/doublestar#92 **What type of PR is this?** > Other **What package or component does this PR mostly affect?** > all **What does this PR do? Why is it needed?** Performance
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
See bmatcuk/doublestar#92 - each time a glob is executed it gets validated if it does not successfully match a path. This now validates it once up front and then avoids re-validating on every (non-matched) glob invocation. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes `aspect configure` glob patterns are now validated once up front instead of per evaluation. ### Test plan - Covered by existing test cases GitOrigin-RevId: 82135c3f6342ea0893d5701b6bb4cfc451e6fe0b
doMatchWithSeparator
does support turning off validationdoublestar/match.go
Line 74 in 180028b
However, it's public counter part doesn't and always enables validation:
doublestar/match.go
Lines 52 to 53 in 180028b
Allowing matching without validation can save some cycles in the use cases where glob patterns have been already validated at an earlier point. A suggested (public) func may look like:
The text was updated successfully, but these errors were encountered: