Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

perf: skip empty frames in mergeComponentStyles#2095

Merged
levithomason merged 20 commits intomasterfrom
perf/skip-empty-merge-styles
Nov 8, 2019
Merged

perf: skip empty frames in mergeComponentStyles#2095
levithomason merged 20 commits intomasterfrom
perf/skip-empty-merge-styles

Conversation

@levithomason
Copy link
Member

@levithomason levithomason commented Nov 6, 2019

This PR skips merging empty frames in mergeComponentStyles. We found this to provide ~15% improvement to component render times:

ChatWithPopover.perf

MIN AVG MAX
First load: 530ms 540ms 600ms
Hot reload: 302ms 310ms 385ms

Skipping unnecessary merges in mergeComponentStyles

MIN AVG MAX AVG DIFF
First load: 430ms 450ms 508ms -90ms, -16%
Hot reload: 255ms 265ms 283ms -45ms, -15%

@levithomason levithomason changed the title skip empty frames in mergeComponentStyles perf: skip empty frames in mergeComponentStyles Nov 6, 2019
Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

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

This filter should now be removed:

_.filter(v, v => {
return !_.isEmpty(v.styles)
}),

@levithomason levithomason force-pushed the perf/skip-empty-merge-styles branch from 0e481ab to 32cfc48 Compare November 8, 2019 16:57
@levithomason levithomason merged commit adbf994 into master Nov 8, 2019
@levithomason levithomason deleted the perf/skip-empty-merge-styles branch November 8, 2019 17:27
levithomason added a commit that referenced this pull request Nov 9, 2019
* feat(Provider): Measure rendering performance stats

* wip

* resolve merge conflicts

* wip skip unnecessary slot/style renders

* wip

* fix duration counted twice

* wip

* restore merge themes

* skip empty frames in mergeComponentStyles

* cleanup cruft

* remove unnecessary empty debug style check

* fix renderComponent bugs

* test: fix mergeThemes styles tests

* fix: mergeThemes circular JSON

* refactor: mergeThemes remove unnecessary code

* fix: mergeThemes test

* docs: update changelog
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.

2 participants