Skip to content

Use a more performant GraphQL visibility plugin. #466

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

myronmarston
Copy link
Collaborator

@myronmarston myronmarston commented Apr 8, 2025

We've observed that the new GraphQL::Schema::Visibility plugin causes a large performance degradation. GraphQL::Schema::Warden does not have this issue, so until it's fixed we'll stick with it.

ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
Warming up --------------------------------------
    Using Visibility    10.000 i/100ms
        Using Warden   248.000 i/100ms
Calculating -------------------------------------
    Using Visibility    102.340 (± 2.0%) i/s    (9.77 ms/i) -    520.000 in   5.082553s
        Using Warden      2.471k (± 4.9%) i/s  (404.71 μs/i) -     12.400k in   5.030776s

Comparison:
        Using Warden:     2470.9 i/s
    Using Visibility:      102.3 i/s - 24.14x  slower

Edit: see rmosolgo/graphql-ruby#5324 for details on this issue.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

We've observed that the new `GraphQL::Schema::Visibility` plugin causes a
large performance degradation. `GraphQL::Schema::Warden` does not have this
issue, so until it's fixed we'll stick with it.

```
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
Warming up --------------------------------------
    Using Visibility    10.000 i/100ms
        Using Warden   248.000 i/100ms
Calculating -------------------------------------
    Using Visibility    102.340 (± 2.0%) i/s    (9.77 ms/i) -    520.000 in   5.082553s
        Using Warden      2.471k (± 4.9%) i/s  (404.71 μs/i) -     12.400k in   5.030776s

Comparison:
        Using Warden:     2470.9 i/s
    Using Visibility:      102.3 i/s - 24.14x  slower
```
@myronmarston myronmarston merged commit b2d2bc2 into main Apr 9, 2025
20 of 21 checks passed
@myronmarston myronmarston deleted the myron/fix-perf branch April 9, 2025 01:07
myronmarston added a commit that referenced this pull request Apr 9, 2025
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.

3 participants