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 useShortcut performance. #19341
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
youknowriad requested review from ajitbohra, ellatrix, jorgefilipecosta and talldan as code owners
December 27, 2019 08:45
youknowriad force-pushed the try/performance-optim-shortcut branch from
December 27, 2019 08:46
239735c
to 5be6dde
Compare
youknowriad added [Type] Code Quality
Issues or PRs that relate to code quality
[Type] Performance
Related to performance efforts
labels
Dec 27, 2019
youknowriad force-pushed the try/performance-optim-shortcut branch from
December 27, 2019 09:09
5be6dde
to eca5bef
Compare
@@ -34,9 +34,13 @@ function isAppleOS( _window = window ) { | |||
function useKeyboardShortcut( shortcuts, callback, { | |||
bindGlobal = false, | |||
eventName = 'keydown', | |||
isDisabled = false, // This is important for performance considerations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's important, but what is it meant to represent? I was confused when I first saw this, 'til I could understand the context for how it's used in this pull request. It would help to have some documentation for this hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Code Quality
Issues or PRs that relate to code quality
[Type] Performance
Related to performance efforts
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
#19332 introduced some performance regressions because of the high number of mousetrap event handlers triggers in the block list.
This PR adds a way to disable the handlers and we're back to similar performance results compared to master.