Skip to content

Conversation

@EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented Sep 18, 2023

fixes #2905

@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2023

🦋 Changeset detected

Latest commit: 1b3524f

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

This PR includes changesets to release 2 packages
Name Type
@graphql-yoga/plugin-response-cache Patch
hello-world-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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2023

Apollo Federation Subgraph Compatibility Results

Federation 1 SupportFederation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2023

💻 Website Preview

The latest changes are available as preview in: https://f481b3db.graphql-yoga.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2023

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}

     checks.......................................: 100.00% ✓ 258838      ✗ 0     
     data_received................................: 1.0 GB  8.7 MB/s
     data_sent....................................: 52 MB   435 kB/s
     http_req_blocked.............................: avg=2.13µs   min=1.2µs    med=1.8µs    max=2.88ms   p(90)=2.4µs    p(95)=2.7µs   
     http_req_connecting..........................: avg=12ns     min=0s       med=0s       max=756.04µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=614.06µs min=300.81µs med=500.93µs max=25.54ms  p(90)=897.75µs p(95)=951.25µs
       { expected_response:true }.................: avg=614.06µs min=300.81µs med=500.93µs max=25.54ms  p(90)=897.75µs p(95)=951.25µs
     ✓ { mode:graphql-jit }.......................: avg=454.23µs min=300.81µs med=391.82µs max=19.22ms  p(90)=470.82µs p(95)=556.4µs 
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=972.94µs min=801.74µs med=890.25µs max=25.54ms  p(90)=997.35µs p(95)=1.19ms  
     ✓ { mode:graphql-response-cache }............: avg=535.3µs  min=368.82µs med=475.42µs max=15.44ms  p(90)=550.93µs p(95)=655.65µs
     ✓ { mode:graphql }...........................: avg=633.81µs min=448.42µs med=544.23µs max=21.15ms  p(90)=680.24µs p(95)=854.6µs 
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 129419
     http_req_receiving...........................: avg=37.17µs  min=20.4µs   med=32.2µs   max=8.52ms   p(90)=46.7µs   p(95)=50.3µs  
     http_req_sending.............................: avg=16.39µs  min=7.6µs    med=10.3µs   max=3.19ms   p(90)=16.9µs   p(95)=19.7µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=560.5µs  min=267.91µs med=452.42µs max=25.47ms  p(90)=851.35µs p(95)=895.05µs
     http_reqs....................................: 129419  1078.459274/s
     iteration_duration...........................: avg=919.77µs min=550.83µs med=797.74µs max=25.85ms  p(90)=1.19ms   p(95)=1.28ms  
     iterations...................................: 129419  1078.459274/s
     vus..........................................: 1       min=1         max=2   
     vus_max......................................: 2       min=2         max=2   

@github-actions
Copy link
Contributor

github-actions bot commented Sep 18, 2023

🚀 Snapshot Release (rc)

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

Package Version Info
@graphql-yoga/plugin-apq 2.0.5-rc-20230920192600-1b3524fc npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-prometheus 2.0.6-rc-20230920192600-1b3524fc npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-response-cache 2.1.2-rc-20230920192600-1b3524fc npm ↗︎ unpkg ↗︎

@gthau
Copy link
Contributor

gthau commented Sep 20, 2023

@EmrysMyrddin could you avoid the runtime penalty by just reexporting a typecast function instead of making an additional nested function call?

export const createInMemoryCache = envelopCreateInMemoryCache as (...args: Parameters<typeof envelopCreateInMemoryCache>) => Cache;

@EmrysMyrddin
Copy link
Collaborator Author

@gthau You are totally right, it's better like this 👍

@theguild-bot theguild-bot mentioned this pull request Sep 27, 2023
@ardatan ardatan merged commit caf7588 into main Sep 27, 2023
@ardatan ardatan deleted the fix/in-memory-cache-factory-type branch September 27, 2023 20:26
This was referenced May 7, 2024
This was referenced May 23, 2024
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.

Incompatible Typescript Cache type when using createInMemoryCache

3 participants