{"id":13880534,"url":"https://github.com/adampetro/bluejay-rb","last_synced_at":"2025-07-16T17:30:38.479Z","repository":{"id":144702314,"uuid":"593836086","full_name":"adampetro/bluejay-rb","owner":"adampetro","description":"A fast GraphQL engine for Ruby.","archived":false,"fork":false,"pushed_at":"2023-09-06T18:35:58.000Z","size":2895,"stargazers_count":30,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-24T10:16:08.583Z","etag":null,"topics":["graphql","ruby"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adampetro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T00:00:57.000Z","updated_at":"2024-08-06T08:48:35.540Z","dependencies_parsed_at":"2024-08-06T08:48:34.428Z","dependency_job_id":"a5e82b4b-9fff-495d-82db-abc053e574c1","html_url":"https://github.com/adampetro/bluejay-rb","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adampetro%2Fbluejay-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adampetro%2Fbluejay-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adampetro%2Fbluejay-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adampetro%2Fbluejay-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adampetro","download_url":"https://codeload.github.com/adampetro/bluejay-rb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226148889,"owners_count":17581048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","ruby"],"created_at":"2024-08-06T08:03:08.171Z","updated_at":"2024-11-24T09:31:53.162Z","avatar_url":"https://github.com/adampetro.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# `bluejay-rb`\n\n\u003e **Warning**\n\u003e This project is still very early in its development and should be considered highly unstable and experimental. It is incomplete and not ready for production use.\n\n\u003e **Note**\n\u003e In an effort to get a working proof-of-concept, documentation and test coverage has been sacrificied. This will be corrected prior to a stable release.\n\n`bluejay-rb` is a GraphQL engine for Ruby written primarily in Rust through the use of [`magnus`](https://github.com/matsadler/magnus).\n\n## Goal\n\n`bluejay-rb`'s goal is to provide a lightning fast GraphQL engine with first-class integration with [Sorbet](https://sorbet.org/). If you do not care deeply about one or both of these goals, then you should seriously consider using the excellent [`graphql-ruby`](https://graphql-ruby.org) gem, which has many more features than `bluejay-rb` in addition to being production-ready and much more customizable.\n\n## Benchmarks\n\nSome benchmarks comparing the performance of `bluejay-rb` against `graphql-ruby` (with C parser) are located at [`/bench`](/bench). The results of some of these benchmarks are included below.\n\n\u003c!---benchmark result start--\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eParse + Execute (Ruby 3.2, YJIT enabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql   158.000  i/100ms\n               bluejay     1.764k i/100ms\n  Calculating -------------------------------------\n               graphql      1.928k (± 2.7%) i/s -      9.638k in   5.003328s\n               bluejay     17.899k (± 2.7%) i/s -     89.964k in   5.029921s\n\n  Comparison:\n               bluejay:    17899.5 i/s\n               graphql:     1927.9 i/s - 9.28x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    45.944k memsize (     2.736k retained)\n                         421.000  objects (    41.000  retained)\n                          12.000  strings (    11.000  retained)\n               bluejay     5.256k memsize (   208.000  retained)\n                          40.000  objects (     2.000  retained)\n                           0.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:       5256 allocated\n               graphql:      45944 allocated - 8.74x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse + Execute (Ruby 3.2, YJIT disabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql    79.000  i/100ms\n               bluejay     1.804k i/100ms\n  Calculating -------------------------------------\n               graphql    781.860  (± 2.2%) i/s -      3.950k in   5.054411s\n               bluejay     18.017k (± 1.6%) i/s -     90.200k in   5.007842s\n\n  Comparison:\n               bluejay:    18016.7 i/s\n               graphql:      781.9 i/s - 23.04x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    45.944k memsize (    21.752k retained)\n                         421.000  objects (   197.000  retained)\n                          12.000  strings (    12.000  retained)\n               bluejay     5.256k memsize (     5.056k retained)\n                          40.000  objects (    35.000  retained)\n                           0.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:       5256 allocated\n               graphql:      45944 allocated - 8.74x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse + Execute with large variables (Ruby 3.2, YJIT enabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql   166.000  i/100ms\n               bluejay     1.101k i/100ms\n  Calculating -------------------------------------\n               graphql      1.642k (± 2.1%) i/s -      8.300k in   5.055691s\n               bluejay     10.876k (± 1.8%) i/s -     55.050k in   5.063054s\n\n  Comparison:\n               bluejay:    10876.3 i/s\n               graphql:     1642.4 i/s - 6.62x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    97.728k memsize (    40.000  retained)\n                         885.000  objects (     1.000  retained)\n                           6.000  strings (     0.000  retained)\n               bluejay    15.640k memsize (    80.000  retained)\n                         228.000  objects (     2.000  retained)\n                          15.000  strings (     1.000  retained)\n\n  Comparison:\n               bluejay:      15640 allocated\n               graphql:      97728 allocated - 6.25x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse + Execute with large variables (Ruby 3.2, YJIT disabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql    79.000  i/100ms\n               bluejay     1.009k i/100ms\n  Calculating -------------------------------------\n               graphql    841.882  (± 1.5%) i/s -      4.266k in   5.068484s\n               bluejay     10.163k (± 2.1%) i/s -     51.459k in   5.065688s\n\n  Comparison:\n               bluejay:    10163.2 i/s\n               graphql:      841.9 i/s - 12.07x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    97.688k memsize (    30.736k retained)\n                         884.000  objects (   319.000  retained)\n                           6.000  strings (     5.000  retained)\n               bluejay    12.600k memsize (   536.000  retained)\n                         152.000  objects (     6.000  retained)\n                           8.000  strings (     1.000  retained)\n\n  Comparison:\n               bluejay:      12600 allocated\n               graphql:      97688 allocated - 7.75x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse small (Ruby 3.2, YJIT enabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               bluejay    39.288k i/100ms\n               graphql     6.906k i/100ms\n  Calculating -------------------------------------\n               bluejay    397.916k (± 1.4%) i/s -      2.004M in   5.036417s\n               graphql     67.671k (± 4.9%) i/s -    338.394k in   5.015897s\n\n  Comparison:\n               bluejay:   397915.9 i/s\n               graphql:    67671.2 i/s - 5.88x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               bluejay     0.000  memsize (     0.000  retained)\n                           0.000  objects (     0.000  retained)\n                           0.000  strings (     0.000  retained)\n               graphql     6.192k memsize (     2.816k retained)\n                          70.000  objects (    37.000  retained)\n                           6.000  strings (     6.000  retained)\n\n  Comparison:\n               bluejay:          0 allocated\n               graphql:       6192 allocated - Infx more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse small (Ruby 3.2, YJIT disabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               bluejay    37.618k i/100ms\n               graphql     6.034k i/100ms\n  Calculating -------------------------------------\n               bluejay    403.347k (± 2.1%) i/s -      2.031M in   5.038540s\n               graphql     59.928k (± 2.0%) i/s -    301.700k in   5.036461s\n\n  Comparison:\n               bluejay:   403347.5 i/s\n               graphql:    59928.3 i/s - 6.73x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               bluejay     0.000  memsize (     0.000  retained)\n                           0.000  objects (     0.000  retained)\n                           0.000  strings (     0.000  retained)\n               graphql     6.192k memsize (     0.000  retained)\n                          70.000  objects (     0.000  retained)\n                           6.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:          0 allocated\n               graphql:       6192 allocated - Infx more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse large (Ruby 3.2, YJIT enabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               bluejay   203.000  i/100ms\n               graphql    30.000  i/100ms\n  Calculating -------------------------------------\n               bluejay      2.106k (± 1.4%) i/s -     10.556k in   5.014156s\n               graphql    308.161  (± 1.9%) i/s -      1.560k in   5.064324s\n\n  Comparison:\n               bluejay:     2105.7 i/s\n               graphql:      308.2 i/s - 6.83x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               bluejay     0.000  memsize (     0.000  retained)\n                           0.000  objects (     0.000  retained)\n                           0.000  strings (     0.000  retained)\n               graphql     1.425M memsize (   556.448k retained)\n                          16.001k objects (     7.541k retained)\n                          50.000  strings (    50.000  retained)\n\n  Comparison:\n               bluejay:          0 allocated\n               graphql:    1425400 allocated - Infx more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse large (Ruby 3.2, YJIT disabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               bluejay   208.000  i/100ms\n               graphql    27.000  i/100ms\n  Calculating -------------------------------------\n               bluejay      2.098k (± 1.6%) i/s -     10.608k in   5.057106s\n               graphql    274.835  (± 1.8%) i/s -      1.377k in   5.011880s\n\n  Comparison:\n               bluejay:     2098.2 i/s\n               graphql:      274.8 i/s - 7.63x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               bluejay     0.000  memsize (     0.000  retained)\n                           0.000  objects (     0.000  retained)\n                           0.000  strings (     0.000  retained)\n               graphql     1.425M memsize (     0.000  retained)\n                          16.001k objects (     0.000  retained)\n                          50.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:          0 allocated\n               graphql:    1425400 allocated - Infx more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse + Validate (Ruby 3.2, YJIT enabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql   504.000  i/100ms\n               bluejay     5.370k i/100ms\n  Calculating -------------------------------------\n               graphql      4.991k (± 6.2%) i/s -     25.200k in   5.073307s\n               bluejay     45.612k (±11.5%) i/s -    225.540k in   5.057627s\n\n  Comparison:\n               bluejay:    45612.5 i/s\n               graphql:     4991.1 i/s - 9.14x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    33.392k memsize (    12.200k retained)\n                         383.000  objects (   152.000  retained)\n                          17.000  strings (    13.000  retained)\n               bluejay    40.000  memsize (    40.000  retained)\n                           1.000  objects (     1.000  retained)\n                           0.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:         40 allocated\n               graphql:      33392 allocated - 834.80x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eParse + Validate (Ruby 3.2, YJIT disabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql   299.000  i/100ms\n               bluejay     4.726k i/100ms\n  Calculating -------------------------------------\n               graphql      2.953k (± 5.0%) i/s -     14.950k in   5.075697s\n               bluejay     51.904k (± 4.0%) i/s -    259.930k in   5.016499s\n\n  Comparison:\n               bluejay:    51904.0 i/s\n               graphql:     2953.1 i/s - 17.58x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    33.304k memsize (    12.320k retained)\n                         381.000  objects (   155.000  retained)\n                          15.000  strings (    13.000  retained)\n               bluejay    40.000  memsize (    40.000  retained)\n                           1.000  objects (     1.000  retained)\n                           0.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:         40 allocated\n               graphql:      33304 allocated - 832.60x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eSchema dump (Ruby 3.2, YJIT enabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql   189.000  i/100ms\n               bluejay     4.228k i/100ms\n  Calculating -------------------------------------\n               graphql      1.929k (± 7.3%) i/s -      9.639k in   5.026688s\n               bluejay     43.632k (± 4.6%) i/s -    219.856k in   5.050598s\n\n  Comparison:\n               bluejay:    43631.9 i/s\n               graphql:     1929.2 i/s - 22.62x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    77.788k memsize (     0.000  retained)\n                         755.000  objects (     0.000  retained)\n                          50.000  strings (     0.000  retained)\n               bluejay   699.000  memsize (     0.000  retained)\n                           1.000  objects (     0.000  retained)\n                           1.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:        699 allocated\n               graphql:      77788 allocated - 111.28x more\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eSchema dump (Ruby 3.2, YJIT disabled)\u003c/summary\u003e\n\n  ```\n  Profiling IPS:\n  Warming up --------------------------------------\n               graphql   157.000  i/100ms\n               bluejay     4.662k i/100ms\n  Calculating -------------------------------------\n               graphql      1.562k (± 1.7%) i/s -      7.850k in   5.027157s\n               bluejay     45.335k (± 3.3%) i/s -    228.438k in   5.044407s\n\n  Comparison:\n               bluejay:    45335.1 i/s\n               graphql:     1561.9 i/s - 29.02x  slower\n\n  Profiling Ruby memory allocations:\n  Calculating -------------------------------------\n               graphql    77.884k memsize (   675.000  retained)\n                         755.000  objects (    10.000  retained)\n                          50.000  strings (     7.000  retained)\n               bluejay   699.000  memsize (     0.000  retained)\n                           1.000  objects (     0.000  retained)\n                           1.000  strings (     0.000  retained)\n\n  Comparison:\n               bluejay:        699 allocated\n               graphql:      77884 allocated - 111.42x more\n  ```\n\u003c/details\u003e\n\u003c!---benchmark result end--\u003e\n\nTo update the benchmark report above, run `rake bench:doc`.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add bluejay\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install bluejay\n\n## Usage\n\nSee an example in the [`/example`](/example) directory. Note the usage of [Tapioca](https://github.com/Shopify/tapioca) RBI generation for the DSL at [`/example/sorbet/rbi/dsl/graph`](/example/sorbet/rbi/dsl/graph)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies and `rake compile` to compile the Rust extension. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\nTo release a new version, update the version number in `version.rb`, and push that to `main`. Then, [create a new release in the GitHub UI](https://github.com/adampetro/bluejay-rb/releases/new) with a new tag equal to the version number in `version.rb` prefixed with `v`. This will trigger the [release workflow](.github/workflows/release.yml) which will publish the new version with pre-built binaries.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadampetro%2Fbluejay-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadampetro%2Fbluejay-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadampetro%2Fbluejay-rb/lists"}