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

reporter: Cache aliasesWithDuplicates to prevent unnecessary re-renders, fixes UI slowdown #4552

Merged
merged 2 commits into from
Jun 24, 2019

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Jun 24, 2019

Fixes #4411

Brings total Command re-renders down to 407 from 80,000+

// do a deep compare here to see if we can use the cached aliases, which will allow mobx's
// @computed identity comparison to pass, preventing unnecessary re-renders
// https://github.com/cypress-io/cypress/issues/4411
if (!_.isEqual(aliasesWithDuplicates, this._aliasesWithDuplicatesCache)) {
Copy link
Contributor Author

@flotwig flotwig Jun 24, 2019

Choose a reason for hiding this comment

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

I wanted to use comparer.structural instead of doing this with lodash (https://mobx.js.org/refguide/computed-decorator.html#builtin-comparers) but it doesn't seem to accomplish the same thing.

@chrisbreiding
Copy link
Contributor

Nice work!

@flotwig flotwig deleted the issue-4411 branch January 24, 2022 18:18
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.

Cypress tests slow down or fail, UI is unresponsive in 3.3.1
3 participants