-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Try adding blockType to context to improve performance #72603
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +197 B (+0.01%) Total Size: 2.19 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 14d0ab7. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18725272116
|
| if ( shouldUseContext ) { | ||
| blockName = privateContext?.name; | ||
| blockType = contextBlockType; | ||
| } else { |
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.
shouldUseContext is never true, as these fall outside the context path (they're generally called from the block inspector or elsewhere). However, reducing subscriptions for use-block-display-title and use-block-display-information would be good.
It may be helpful to have more concrete PR description that explains what the goal and expectations of this are. The performance test run seems to demonstrate improvements within the margin of error, too - what specific improvements are we aiming/expecting to get? |
|
@tyxla It's a part of exploring potential performance improvements - this wasn't intended to be reviewed yet but see what the performance tests from CI would report. Sometimes they vary from running them locally. I was using "Try" in the title and leaving the PR description blank to indicate that. If I recall correctly, draft PRs don't run the performance metrics, otherwise I would have used that. I might be misremembering that though. Sounds like either way a short PR description would have been helpful though. I'll start adding a brief one even on exploration PRs. |
|
Ah, for some reason I hadn't considered leaving it in draft then triggering it manually. Good tip.
I think it's automatically requested when making changes to certain files? I did not manually request a review for this PR. |
Not for a draft PR. |

What?
Exploring general performance improvements in Gutenberg, as the metrics have been creeping upwards. This PR attempts to add blockType to the context to see if we can reduce some subscriptions that would lead to perf imrprovements.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast