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

Improve performance for addEventKeys #1208

Merged
merged 1 commit into from
Dec 20, 2018

Conversation

MxFr
Copy link

@MxFr MxFr commented Dec 18, 2018

I improved the performance of my charts with large datasets significantly by changing the getEventKey function in away that a new object is only created when eventKey is set in the props.

My reasoning for this change is:

  1. If the datum has already an eventKey field, assign adds nothing.
  2. If the index is used as fallback for eventKey the fallback can be (and already is in most cases) performed in the Components getBaseProps.
  3. If the eventKey is computed the old behavior is required.

In my use case the perfomance of chart updates nearly doubled.

@boygirl
Copy link
Contributor

boygirl commented Dec 19, 2018

@MxFr Thanks so much! That's an exciting perf improvement. From my first look this looks good, but I will give it a more thorough review tonight / tomorrow.

@boygirl
Copy link
Contributor

boygirl commented Dec 20, 2018

@MxFr This looks good. Merging now.

@boygirl boygirl merged commit a4e2b08 into FormidableLabs:master Dec 20, 2018
@MxFr MxFr deleted the performance-eventkey branch January 7, 2019 08:14
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