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

Optimize the insertion point component #12384

Conversation

youknowriad
Copy link
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 sgomes, aduth and a team November 28, 2018 14:03
const showInsertionPoint = (
isBlockInsertionPointVisible() &&
insertionPoint.index === insertIndex &&
insertionPoint.rootClientId === rootClientId &&
! isUnmodifiedDefaultBlock( block )
Copy link
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