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

[issue #45] - Performance optimizations, reduced wasted renders #48

Merged
merged 3 commits into from
Apr 14, 2016

Conversation

sergesemashko
Copy link

Related issue #45.

What's done:

  • Decomposed LogMonitor, created LogMonitorEntryList, so log array is recalculated only when props are updated
  • Added debounced scroll listener to container, so scrollTop is updated only when scroll ends

Test case I was performing:

  • add new item to a list of 300+ actions.

Here are the Perf.printWasted() results:

Before:

After:

So, I think wasted renders should be fixed within this pull request.

As for inlined styles that cause long compsite layout and rendering operations, it will require more complex solution like make inlined styles shared in react-json-tree. That should improve rendering performance.
I might take a look into that next week.

@gaearon, please review and thanks for providing such a nice opportunity to contribute.

sergesemashko added 2 commits April 3, 2016 19:55
- Decomposed LogMonitor, created LogMonitorEntryList, so log array is recalculated only when props are updated
- added debounced scroll listener to container, so scrollTop is updated only when scroll ends
@gaearon
Copy link
Owner

gaearon commented Apr 5, 2016

This looks great! I'll check it out in a few days. Thank you!

@gaearon
Copy link
Owner

gaearon commented Apr 13, 2016

This is taking me longer than I wish but please don't feel discouraged. Feel free to pile more optimizations until I get a chance to review.

@gaearon gaearon merged commit 82c72ba into gaearon:master Apr 14, 2016
@gaearon
Copy link
Owner

gaearon commented Apr 14, 2016

This is out in 1.0.10, thank you!

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