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

Performance: Factor out BlockMultiControls component from VisualEditorBlock #3172

Merged
merged 1 commit into from
Nov 9, 2017

Conversation

aduth
Copy link
Member

@aduth aduth commented Oct 26, 2017

Related: #3171, #3170

This pull request seeks to optimize the rendering of individual blocks when selection occurs. Currently, any time a selection is made, including for a single block, the multiSelectedBlockUids prop changes for every block such that it incurs a render on all blocks. The changes here seek to factor out a separate BlockMultiControls component which receives the changing multiSelectedBlockUids, thereby preventing renders except in the block responsible for rendering the multi-selection block controls.

Testing instructions:

Verify there are no regressions in the behavior of block multi-selection.

@aduth aduth added the [Type] Performance Related to performance efforts label Oct 26, 2017
@aduth aduth force-pushed the update/perf-multi-select-controls branch from 1fc94c9 to 488a891 Compare October 27, 2017 14:00
@codecov
Copy link

codecov bot commented Oct 27, 2017

Codecov Report

Merging #3172 into master will decrease coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3172      +/-   ##
==========================================
- Coverage    31.3%   31.25%   -0.06%     
==========================================
  Files         246      247       +1     
  Lines        6762     6773      +11     
  Branches     1213     1214       +1     
==========================================
  Hits         2117     2117              
- Misses       3909     3919      +10     
- Partials      736      737       +1
Impacted Files Coverage Δ
editor/modes/visual-editor/block.js 0% <0%> (ø) ⬆️
editor/modes/visual-editor/multi-controls.js 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3b128f...a23bf91. Read the comment docs.

@aduth aduth force-pushed the update/perf-multi-select-controls branch from 488a891 to a23bf91 Compare November 7, 2017 20:20
@aduth aduth requested review from ellatrix and mcsf November 7, 2017 20:20
Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

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

Makes sense and tests well for me. Kudos for this and the other performance improvements.

@aduth aduth merged commit 9580c08 into master Nov 9, 2017
@aduth aduth deleted the update/perf-multi-select-controls branch November 9, 2017 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants