Merged
Conversation
Collaborator
Author
|
Oh didn't realize Ruby 2.7 was still supported 😓 so |
- ArgumentNamesAreUnique: avoid Hash.new block allocation on the common unique-args path; only build array on actual collision - FieldsHaveAppropriateSelections: fast-path leaf+no-selections and non-leaf+selections cases, skipping the full validation method - RequiredArgumentsArePresent: cache required arg names per definition to avoid re-iterating arguments for repeated field definitions context.query.types to reduce method dispatch
6fe9e2f to
a7af5e4
Compare
Owner
|
Thanks for these improvements! I'll have to keep intersect in mind for when we drop Ruby 2.7 support. I think there are other places it could be used, too, for example: |
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.
Extracted from #5578
These a few miscellaneous micro-optimizations to validation rules.
ArgumentNamesAreUnique: avoid Hash.new block allocation on the common unique-args path; only build array on actual collisionFieldsHaveAppropriateSelections: fast-path leaf+no-selections and non-leaf+selections cases, skipping the full validation methodRequiredArgumentsArePresent: cache required arg names per definition to avoid re-iterating arguments for repeated field definitions-FragmentSpreadsArePossible: use Array#intersect? instead of none? { include? } for type overlap checkNote: I'm keeping all the
FieldsWillMergeoptimizations for their own PR.