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

fix(graphcache): Replace selection iterator implementation for JSC memory reduction #3693

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

kitten
Copy link
Member

@kitten kitten commented Oct 19, 2024

Related to #3690
Related to 0no-co/graphql.web#33

Summary

Attempt to get JSC memory usage under control by dropping the nested anonymous-function based iterator implementation with one with a manual stack. This has also been updated to use a class in the hopes of getting JSC to drop memory used by the iterator faster and reduce overall usage.
In testing, JSC seems to hang on to a large amount of scope memory due to the prior implementation.

Note

Synthetic benchmarks are currently not present anymore (TBD). Browser benchmarks don't run anymore. Tests are currently broken for individual packages. In theory, however, we should be able to use Tachometer + Webdriver Safari to run the browser benchmarks on JSC to get comparative numbers.

Set of changes

  • Replace makeSelectionIterator with new stack-based implementation

Copy link

changeset-bot bot commented Oct 19, 2024

🦋 Changeset detected

Latest commit: e191b9f

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

This PR includes changesets to release 1 package
Name Type
@urql/exchange-graphcache 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

@kitten kitten merged commit 4641c39 into main Oct 19, 2024
13 checks passed
@kitten kitten deleted the fix/jsc-selection-iterator-stack branch October 19, 2024 20:55
@github-actions github-actions bot mentioned this pull request Oct 19, 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.

2 participants