perf(registry): early exit matches_partial#1441
Merged
Nytelife26 merged 2 commits intomainfrom Oct 3, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1441 +/- ##
==========================================
- Coverage 94.28% 94.15% -0.14%
==========================================
Files 99 99
Lines 805 804 -1
==========================================
- Hits 759 757 -2
- Misses 46 47 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
As @drainpixie noticed in #1440, checking segment sequences is equivalent to asking if the raw path starts with the partial key followed by the delimiter. This greatly improves the performance of matches_partial in the fallback case (3x on my system). Co-authored-by: drainpixie <121581793+drainpixie@users.noreply.github.com>
Contributor
Author
|
This is ready for review @drainpixie (should be the easiest approve in our lifetimes) |
drainpixie
approved these changes
Oct 3, 2025
Collaborator
|
:D |
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.
Relevant issues
Intended to help with #1440.
Brief
Improve performance of
check.matches_partialby 85% in the case of a full match using a fast equality, and 66% in all other cases by usingstartswith.Acknowledgements
Credit to @drainpixie for noticing the equivalence of these operations.