-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Proof of Concept] Optimize how shared block style variations are processed #6868
[Proof of Concept] Optimize how shared block style variations are processed #6868
Conversation
This is just a proof of concept, but I wanted to share the approach as soon as possible to gather feedback and gauge the impact on performance (not much so far, as far as I see). What works:
What doesn't:
Viability of the PoC:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
I like the idea of trying to move this processing directly into the parsing of a I ran some initial profiles on this PR compared with the parent commit (c1c8d30) and can confirm that it currently has very little impact, but that is mostly because the processing being skipped, Looking further into the profiling data, it looks like when |
#6873 takes the ideas from this PR and does a few other things. |
#6873 implements this Proof of concept so this can be closed. |
Trac ticket https://core.trac.wordpress.org/ticket/61451
Follow-up work for https://core.trac.wordpress.org/ticket/61312
What
This PR tries to optimize the data flow for operating with section styles.
Why
It has proven less optimized than we wanted.
How
At some point, the code transforms the following:
into:
The existing code executes that transformation using the
wp_theme_json_data_*
filters – having to recreate theWP_Theme_JSON
structures a few times.The optimization proposed in this PR explores moving that transform into the
WP_Theme_JSON
constructor directly, following what we do withappearanceTools
settings.Test
TBD.