Navigation: minimize the number of innerblocks renders #58506
Closed
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.
NOT TO MERGE.
What?
This PR is an experiment to minimize the number of
$inner_blocks
renders in the navigation block.Why?
The initial package update for 6.5 took a performance hit. Part of it was due to the navigation block render refactor at #55605. That PR increased from 1 to 6 the number of times its inner blocks rendered, causing a cascade of other updates, degrading performance.
WP_Block->render
See also some kcachegrind visualizations:
I'm also sharing the cachegrind-logs.zip for people to inspect by their own. qcachegrind (macos) or kcachegrind (linux) can be used to open and inspect the files (see images in table).
How?
TBD.
The test case here just demonstrate how this is an issue, but it's not the proper implementation.
Testing Instructions
TBD.
The performance tests in Gutenberg won't report any performance impact, the same #55605 didn't. The reason is that the test data doesn't cover the navigation block appropriately. The core performance tests cover more ground for the navigation block.
These changes are ported to core via the
@wordpress/block-library
package. How can we test the changes in this PR in core?