Skip to content

Conversation

@jackricci
Copy link

@jackricci jackricci commented Sep 22, 2020

Since the reference equality check to compare previous props with the new props fails when new props are passed in that have the same values as the previous props, reflow was getting called every time the component re-rendered, leading to a huge performance hit.

By using LoDash's deep object equality comparison, we're able to eliminate unnecessary calls to reflow that are getting made when props hasn't changed.

Performance improvement:
On a page with 48 LinesEllipsis components already rendered, when I update the page to render an additional 24 LinesEllipses components:

  • With this PR: This takes ~2.5 seconds to paint all 72 LinesEllipses components to screen
  • Without this PR: This takes ~21 seconds to paint all 72 LinesEllipses components to screen

@jackricci jackricci changed the title Fix/Selectively Call Reflow on Component Update Selectively Call Reflow on Component Update Sep 22, 2020
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.

1 participant