[wp-trac] [WordPress Trac] #59595: Improve performance of WP_Theme_JSON::compute_style_properties

WordPress Trac noreply at wordpress.org
Fri Jun 21 22:41:03 UTC 2024


#59595: Improve performance of WP_Theme_JSON::compute_style_properties
-----------------------------------------+--------------------------
 Reporter:  spacedmonkey                 |       Owner:  thekt12
     Type:  enhancement                  |      Status:  reopened
 Priority:  normal                       |   Milestone:  6.6
Component:  Editor                       |     Version:  5.8
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  performance
-----------------------------------------+--------------------------

Comment (by joemcgill):

 After spending some time reviewing the caching strategy implemented in
 [58334], in light of
 [https://core.trac.wordpress.org/ticket/59595#comment:55 my previous
 comment], I have worked on a proof of concept PR that tries to avoid the
 extra DB query introduced here, but I have a few concerns.

 To avoid the extra DB query, we can move the hash to inside the transient,
 but we're currently using the hash key as a way to differentiate different
 caches on the same network, using site transients. However, site
 transients never get autoloaded, even if they never expire.

 I've moved the hash to a value stored inside the transient value, as a way
 to validate the cache and rebuild if needed. Even so, the addition of
 `wp_prime_option_caches()` to `set_transient()` (et al.) in [58134] is
 causing an extra query to prime the timeout value, even if no expiration
 is present and the value has been autoloaded. That is probably worth a
 separate ticket altogether, but worth mentioning here.

 I'm not seeing a big performance difference with avoiding the extra query,
 so I don't know that any additional changes are needed here for 6.6,
 unless additional bugs are reported.

 @thekt12, @spacedmonkey, and @peterwilsoncc, I'd appreciate your thoughts
 here — both on the proposed changes in [https://github.com/WordPress
 /wordpress-develop/pull/6879 PR #6879] as well as the broader concerns
 about priming timeouts behavior.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59595#comment:61>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list