-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Avoid running hasMetaBoxes on each subscribe #15041
Conversation
Is there a sense of why it has a noted impact? Curious if there's something problematic of the underlying selector. I'd probably agree if we can be certain it's initialized once, it would be fine to move it out of the |
Co-Authored-By: youknowriad <benguella@gmail.com>
…rnmobile/887-History-stack-is-not-empty-on-a-fresh-start-of-the-editor * 'master' of https://github.com/WordPress/gutenberg: Avoid running hasMetaBoxes on each subscribe (#15041) Avoid passing down isFirst and isLast props (#15043) Add "Roadmap" document with an overview of projects in consideration. (#14907) Testing: Update tests to use Escape press to activate block toolbar (#15063) Testing: Skip unreliable end-to-end tests (#15059)
Looks like this was merged with failing tests. |
yep sorry about that missed it, I included the suggestion above and thought was harmless cause it was just a comment :) |
While monitoring the typing performance, I noticed that in the duraction of the key press event (53ms), 2 or 3ms is spent on calling
hasMetaboxes
selector. In this PR, I'm managing to tweak the side effect a little bit to avoid calling this selector on each subscribe.While if we're trying to be pure, we should call the selector on each subscribe, in this particular use-cases where this is a legacy API that is only initialized at rendering, I think it's fine to optimize this way.