Skip to content

Optimize the insertion point component#12384

Merged
youknowriad merged 1 commit intoperf/avoid-previous-block-selectorfrom
update/optimize-insertion-point
Nov 30, 2018
Merged

Optimize the insertion point component#12384
youknowriad merged 1 commit intoperf/avoid-previous-block-selectorfrom
update/optimize-insertion-point

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

This PR avoids calling the getBlock selector in the InsertionPoint component. I'm not really certain why this call was necessary. It doesn't seem to harm the experience in my testing.

This is a 6% performance improvement when typing.

@youknowriad youknowriad added the [Type] Performance Related to performance efforts label Nov 28, 2018
@youknowriad youknowriad requested review from a team, aduth and sgomes November 28, 2018 14:03
isBlockInsertionPointVisible() &&
insertionPoint.index === insertIndex &&
insertionPoint.rootClientId === rootClientId &&
! isUnmodifiedDefaultBlock( block )
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This basically says, we don't show the insertion point indicator if the block is empty (empty paragraph block). I don't really understand why personally in addition to the fact that it harms the performance. @jasmussen Thoughts on that? How does the insertion indicator works on this PR for you?

@youknowriad youknowriad merged commit 5216124 into perf/avoid-previous-block-selector Nov 30, 2018
@youknowriad youknowriad deleted the update/optimize-insertion-point branch November 30, 2018 08:14
youknowriad added a commit that referenced this pull request Nov 30, 2018
* Avoid rerending the current block if the previous block change

* Always show the sibling inserter

* Optimize the insertion point component (#12384)
youknowriad added a commit that referenced this pull request Nov 30, 2018
* Avoid getBlock in block-list/block

* Update data docs

* Fix unit tests post rebase :)

* Rename props

* Clarify the filter position

* Avoid repeating the selector dependants

* Fix small typo in the docs

* Avoid rerending the current block if the previous block change (#12379)

* Avoid rerending the current block if the previous block change

* Always show the sibling inserter

* Optimize the insertion point component (#12384)

* Fix lock file

* Fix linting
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.

3 participants