Skip to content
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

Optimize OrderedArguments and FieldDefinitions cops #157

Merged
merged 1 commit into from
May 3, 2024

Conversation

fatkodima
Copy link
Contributor

We currently have a very large file where this gem's cops stuck and never finish. The reasons are that lib/rubocop/graphql/sorbet.rb uses O(n^2) loop and lib/rubocop/cop/graphql/ordered_arguments.rb performs a costly traversing of the descendants tree twice, where only one would suffice.

After these changes, now rubocop finishes in 17 seconds for that file.

Copy link
Owner

@DmitryTsepelev DmitryTsepelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Could you please move things around to make Rubocop happy? 🙂

@fatkodima
Copy link
Contributor Author

Made rubocop happy 😄

@DmitryTsepelev DmitryTsepelev merged commit 68ffb65 into DmitryTsepelev:master May 3, 2024
10 checks passed
@fatkodima fatkodima deleted the optimizations branch May 3, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants