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 unnecessary re-rendering of various components when typing in web UI #15286

Merged
merged 1 commit into from
Dec 7, 2020

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Dec 7, 2020

Due to a componentDidUpdate being caused by router change in ColumnsArea, a state change was unnecessarily triggered which caused the whole UI to re-render from the top down. Also, the new pictureInPicture attribute caused unnecessary re-renders on Status components.

@Gargron Gargron added the performance Runtime performance label Dec 7, 2020
@Gargron Gargron force-pushed the fix-typing-performance-web-ui branch from 42eeb93 to c3beb60 Compare December 7, 2020 02:53
@ClearlyClaire ClearlyClaire self-requested a review December 7, 2020 16:45
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

I am unsure about the ColumnsArea changes. The other stuff looks good to me.

Comment on lines -102 to +108
this.lastIndex = getIndex(this.context.router.history.location.pathname);
this.setState({ shouldAnimate: true });

const newIndex = getIndex(this.context.router.history.location.pathname);

if (this.lastIndex !== newIndex) {
this.lastIndex = newIndex;
this.setState({ shouldAnimate: true });
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am very unsure about this and haven't seen much benefit to this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I am ok with this change, although the whole shouldAnimate thing is buggy and I will try to improve it.

Comment on lines -102 to +108
this.lastIndex = getIndex(this.context.router.history.location.pathname);
this.setState({ shouldAnimate: true });

const newIndex = getIndex(this.context.router.history.location.pathname);

if (this.lastIndex !== newIndex) {
this.lastIndex = newIndex;
this.setState({ shouldAnimate: true });
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I am ok with this change, although the whole shouldAnimate thing is buggy and I will try to improve it.

@Gargron Gargron merged commit 9620ee9 into master Dec 7, 2020
@Gargron Gargron deleted the fix-typing-performance-web-ui branch December 7, 2020 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Runtime performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants