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

GraphQL JIT enhancements #1992

Merged
merged 7 commits into from
Oct 11, 2023
Merged

GraphQL JIT enhancements #1992

merged 7 commits into from
Oct 11, 2023

Conversation

ardatan
Copy link
Collaborator

@ardatan ardatan commented Oct 9, 2023

@changeset-bot
Copy link

changeset-bot bot commented Oct 9, 2023

🦋 Changeset detected

Latest commit: 7f29036

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

This PR includes changesets to release 1 package
Name Type
@envelop/graphql-jit Major

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 Oct 9, 2023

💻 Website Preview

The latest changes are available as preview in: https://499131cb.envelop.pages.dev

typeof pluginOptions.cache !== 'undefined'
? pluginOptions.cache
: new LRUCache<string, JITCacheEntry>({ max: DEFAULT_MAX, ttl: DEFAULT_TTL });
const jitCacheByDocumentString = pluginOptions.cache;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This means that the cache is now disabled by default ?

Copy link
Collaborator Author

@ardatan ardatan Oct 10, 2023

Choose a reason for hiding this comment

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

Yes, we no longer provide a default LRU cache.
For Yoga, users can rely on the WeakMap based on DocumentNode which is cached by parser cache of Yoga itself.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2023

🚀 Snapshot Release (alpha)

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

Package Version Info
@envelop/graphql-jit 7.0.0-alpha-20231010181531-7f290367 npm ↗︎ unpkg ↗︎
@envelop/response-cache 5.4.0-alpha-20231010181531-7f290367 npm ↗︎ unpkg ↗︎
@envelop/response-cache-redis 3.4.0-alpha-20231010181531-7f290367 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

theguild-bot commented Oct 10, 2023

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.............................................: 100.00% ✓ 554916      ✗ 0     
     data_received......................................: 2.1 GB  14 MB/s
     data_sent..........................................: 121 MB  804 kB/s
     envelop_total......................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:prom-tracing }............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     event_loop_lag.....................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:prom-tracing }............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_blocked...................................: avg=2.16µs  min=700ns    med=1.4µs   max=11.56ms p(90)=2.1µs   p(95)=2.5µs  
     http_req_connecting................................: avg=218ns   min=0s       med=0s      max=11.53ms p(90)=0s      p(95)=0s     
     http_req_duration..................................: avg=5.08ms  min=181µs    med=3.74ms  max=86.94ms p(90)=9.57ms  p(95)=17.01ms
       { expected_response:true }.......................: avg=5.08ms  min=181µs    med=3.74ms  max=86.94ms p(90)=9.57ms  p(95)=17.01ms
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=4.39ms  min=434.1µs  med=3.82ms  max=48.88ms p(90)=7.36ms  p(95)=8.47ms 
     ✓ { mode:envelop-cache-jit }.......................: avg=2.7ms   min=181µs    med=2.33ms  max=40.24ms p(90)=4.42ms  p(95)=5.89ms 
     ✓ { mode:envelop-just-cache }......................: avg=4.46ms  min=443.9µs  med=3.81ms  max=47.59ms p(90)=7.56ms  p(95)=8.75ms 
     ✓ { mode:graphql-js }..............................: avg=7.73ms  min=823.01µs med=6.53ms  max=70.12ms p(90)=12.39ms p(95)=13.92ms
     ✓ { mode:prom-tracing }............................: avg=20.09ms min=4.58ms   med=17.92ms max=86.94ms p(90)=33.51ms p(95)=35.79ms
     http_req_failed....................................: 0.00%   ✓ 0           ✗ 277458
     http_req_receiving.................................: avg=43.88µs min=12.5µs   med=23.8µs  max=39.28ms p(90)=36.5µs  p(95)=42.9µs 
     http_req_sending...................................: avg=32.84µs min=4.8µs    med=8.4µs   max=17.98ms p(90)=15.5µs  p(95)=22.1µs 
     http_req_tls_handshaking...........................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_waiting...................................: avg=5ms     min=156.8µs  med=3.69ms  max=86.84ms p(90)=9.29ms  p(95)=16.85ms
     http_reqs..........................................: 277458  1849.605601/s
     iteration_duration.................................: avg=5.4ms   min=399.1µs  med=4ms     max=87.31ms p(90)=10.1ms  p(95)=17.41ms
     iterations.........................................: 277458  1849.605601/s
     vus................................................: 10      min=10        max=10  
     vus_max............................................: 20      min=20        max=20  

@ardatan ardatan merged commit a07b295 into main Oct 11, 2023
19 checks passed
@ardatan ardatan deleted the graphql-jit-cache branch December 2, 2024 09:20
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