[wp-trac] [WordPress Trac] #59178: Performance optimization of wp_get_block_css_selector()

WordPress Trac noreply at wordpress.org
Thu Aug 24 19:57:30 UTC 2023


#59178: Performance optimization of wp_get_block_css_selector()
-------------------------------------------------+-------------------------
 Reporter:  mukesh27                             |       Owner:
                                                 |  davidbaumwald
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Editor                               |     Version:  6.3
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  needs-patch has-screenshots good-    |     Focuses:
  first-bug                                      |  performance
-------------------------------------------------+-------------------------
Changes (by davidbaumwald):

 * owner:  (none) => davidbaumwald
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56457" 56457]:
 {{{
 #!CommitTicketReference repository="" revision="56457"
 Editor: Optimize `wp_get_block_css_selector` to remove `array_merge` calls
 for better performance.

 Some block themes like TT3 use `wp_get_block_css_selector` to determine a
 CSS selector based on block type and other parameters.  However, recent
 performance profiling indicated a bottleneck in
 `wp_get_block_css_selector`, particularly sections that utilize
 `array_merge`.  By slightly refactoring these sections, `array_merge`
 calls can be avoided which increases performance.

 Props mukesh27, joemcgill, daxelrod, tabrisrp.
 Fixes #59178.
 }}}

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


More information about the wp-trac mailing list