fix(graphcache): Replace selection iterator implementation for JSC memory reduction #3693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
makeSelectionIterator
with new stack-based implementation