Skip to content

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Aug 4, 2023

DRAFT PR TO SEE THE IMPACT ON PERFORMANCE TESTS. NOT TO MERGE.

Related #45171

What?

A few changes to improve some ms out of the WP_Theme_JSON->get_stylesheet performance.

Why?

Faster is better.

How?

TBD.

Testing Instructions

See the impact of the performance tests. TBD.

The layout definitions are static and defined by the code,
so there is no need to sanitize them.
WordPress core uses that filter to remove the block nodes. A more performant
implementation is simply return the top-level style nodes.

This needs removing the filter wp_theme_json_get_style_nodes in core as well.
@oandregal oandregal self-assigned this Aug 4, 2023
@oandregal oandregal added the [Type] Performance Related to performance efforts label Aug 4, 2023
@github-actions
Copy link

github-actions bot commented Aug 4, 2023

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/class-wp-theme-json-gutenberg.php

@oandregal
Copy link
Member Author

The changes that were worth doing were extracted to individual PRs.

@oandregal oandregal closed this Aug 11, 2023
@oandregal oandregal deleted the try/improve-get-stylesheet-performance branch August 11, 2023 15:13
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.

1 participant