-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Backport: WP_Theme_JSON_Resolver changes #3901
Backport: WP_Theme_JSON_Resolver changes #3901
Conversation
c83e48a
to
f3cc87c
Compare
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.
small docblock change proposal
|
||
wp_recursive_ksort( $data ); | ||
wp_recursive_ksort( $expected ); | ||
|
||
$this->assertSameSets( $data, $expected ); |
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.
Is it preferred sorting arrays before assertions, or can we use something like assertEqualsCanonicalizing
?
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.
Here the deeply nested array of arrays are being recursively key sorted before the assertion. assertSameSets()
repeats an index sort at the first dimension of the arrays. That's not necessary.
Instead of assertSameSets()
, use assertSame()
.
I'm wondering though why this needed. Pulling down to explore.
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.
Hi, @hellofromtonya
Let me know if any follow-ups are needed for PHPUnits tests on this PR.
Hey @Mamaduka, is this PR and Trac ticket still needed? I remember you were breaking up the GB PRs into smaller Trac tickets. Just checking before I dive into it. |
@hellofromtonya, that was for |
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.
Thanks for the PR @Mamaduka! Just a few suggestions. 🙂
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Thanks for the suggestions, @costdev! |
Performance check ✅I gave this some server-side performance tests for the frontend, measuring TT3 on the home page and a single post with the Gutenberg demo content, using https://gist.github.com/felixarntz/de5c697a1a16c2b892634b70216eb6c7. TLDR / Summary / ConclusionResults look inconclusive. Function-specific benchmarks show a clear improvement, while overall WordPress execution time shows inconsistent results between the two tests. This suggests that the changes in this PR probably enhance performance, but overall does not have a great impact on performance. At the same time, it also means that there is no concern about merging this, so we can proceed from that perspective. ResultsAll times below are in milliseconds. First I benchmarked overall WP load time. Every test row below is actually based on the median of 20 runs itself. So overall this is 120 runs per scenario.
Because the results didn't show a clear trend in either direction, I wanted to see at least more specifically whether certain Here are the results for
Here are the results for
Both of the above show improvements for their respective method's performance, so that's promising. We will have to see whether this has any impact in the field, but overall it certainly looks unproblematic, and if anything, there is a positive trend in Note: The |
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.
@Mamaduka Thanks! Code-wise this all looks solid to me, and performance-wise as well per my above feedback.
Thanks for the reviews and testing, folks 🙇 It would be great to get this committed before Beta 1. |
Committed via: https://core.trac.wordpress.org/changeset/55231 |
Backport changes and fixes merged into a Gutenberg plugin after WP 6.1.
Related Gutenberg PRs:
I'm going to backport WordPress/gutenberg#46112 separately.
Trac ticket: https://core.trac.wordpress.org/ticket/57545
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.