graphql-tools icon indicating copy to clipboard operation
graphql-tools copied to clipboard

enhance(federation): optimize the delegation stage, and remove extra subgraph calls when possible

Open ardatan opened this issue 1 year ago • 4 comments

If there is a subschema with some selection set, and another with some other selection set. After the calculation of delegation stage, if one subschema can cover the other selection set as well, then we can merge the two selection sets into one, and remove the other subschema from the stage.

ardatan avatar May 13 '24 14:05 ardatan

🦋 Changeset detected

Latest commit: 428598465ee326098eddbc2163902943659556ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@graphql-tools/stitch Patch
federation-benchmark Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 13 '24 14:05 changeset-bot[bot]

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/stitch 9.2.9-alpha-20240516081901-428598465ee326098eddbc2163902943659556ce npm ↗︎ unpkg ↗︎

github-actions[bot] avatar May 13 '24 14:05 github-actions[bot]

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.........................: 100.00% ✓ 316       ✗ 0  
     data_received..................: 37 MB   3.7 MB/s
     data_sent......................: 135 kB  14 kB/s
     http_req_blocked...............: avg=4.6µs    min=2.22µs   med=2.9µs    max=232µs    p(90)=4.09µs   p(95)=4.54µs  
     http_req_connecting............: avg=978ns    min=0s       med=0s       max=154.59µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=58.97ms  min=50.98ms  med=56.42ms  max=149.39ms p(90)=62.92ms  p(95)=86.71ms 
       { expected_response:true }...: avg=58.97ms  min=50.98ms  med=56.42ms  max=149.39ms p(90)=62.92ms  p(95)=86.71ms 
     http_req_failed................: 0.00%   ✓ 0         ✗ 158
     http_req_receiving.............: avg=134.72µs min=110.98µs med=130.66µs max=304.71µs p(90)=152.73µs p(95)=165.94µs
     http_req_sending...............: avg=26.42µs  min=17.87µs  med=25.94µs  max=69.91µs  p(90)=31.66µs  p(95)=36.66µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=58.81ms  min=50.82ms  med=56.26ms  max=149.02ms p(90)=62.73ms  p(95)=86.56ms 
     http_reqs......................: 158     15.762871/s
     iteration_duration.............: avg=63.41ms  min=54.7ms   med=60.47ms  max=154.88ms p(90)=73.5ms   p(95)=90.88ms 
     iterations.....................: 158     15.762871/s
     vus............................: 1       min=1       max=1
     vus_max........................: 1       min=1       max=1

github-actions[bot] avatar May 13 '24 14:05 github-actions[bot]

💻 Website Preview

The latest changes are available as preview in: https://1183c443.graphql-tools.pages.dev

github-actions[bot] avatar May 13 '24 14:05 github-actions[bot]