Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Fix performance degradation#200

Merged
Marc-Andre-Rivet merged 2 commits intomasterfrom
3.1-issue198-performance
Nov 1, 2018
Merged

Fix performance degradation#200
Marc-Andre-Rivet merged 2 commits intomasterfrom
3.1-issue198-performance

Conversation

@Marc-Andre-Rivet
Copy link
Copy Markdown
Contributor

Fixes #198

@chriddyp chriddyp temporarily deployed to dash-table-review-pr-200 November 1, 2018 20:02 Inactive

private calculateTableStyle = memoizeOne((style: Partial<IStyle>) => R.mergeAll(
this.tableStyle(DEFAULT_STYLE, style)
));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

style_table rarely changes, merging it with DEFAULT_STYLE creates a new object each time, triggering lots of re-renders and layout reevaluations. Memoizing the value prevents those problematic re-renders from occurring and brings performance back to what it used to be.

Copy link
Copy Markdown
Contributor

@valentijnnieman valentijnnieman left a comment

Choose a reason for hiding this comment

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

Awesome, sounds good!

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit 3e720b7 into master Nov 1, 2018
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 3.1-issue198-performance branch July 18, 2019 12:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants