[wp-trac] [WordPress Trac] #58457: Optimize `WP_Theme_JSON::append_to_selector`

WordPress Trac noreply at wordpress.org
Mon Jun 5 15:44:16 UTC 2023


#58457: Optimize `WP_Theme_JSON::append_to_selector`
-------------------------+-----------------------------
 Reporter:  bor0         |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch
  Focuses:  performance  |
-------------------------+-----------------------------
 On a basic WordPress installation, visiting the frontend page shows about
 1104 calls to the function `WP_Theme_JSON::append_to_selector`.

 We find a way to optimize the function by bringing the conditional check
 one level above. While it increases code verbosity, it also improves
 performance, as can be seen by the attached images.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58457>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list