[wp-trac] [WordPress Trac] #59969: Conditional loading `build_template_part_block_variations` for performance improvement

WordPress Trac noreply at wordpress.org
Fri Feb 9 16:52:45 UTC 2024


#59969: Conditional loading `build_template_part_block_variations` for performance
improvement
--------------------------------------------+--------------------------
 Reporter:  thekt12                         |       Owner:  joemcgill
     Type:  defect (bug)                    |      Status:  reopened
 Priority:  normal                          |   Milestone:  6.5
Component:  General                         |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch needs-dev-note close  |     Focuses:  performance
--------------------------------------------+--------------------------

Comment (by joemcgill):

 Tried to capture some performance numbers for this change today, but due
 to the fact that the potential improvement is only measurable after the
 updates to the core blocks making use of this feature were synced in
 r57377, it's not easy to do a direct A/B comparison via benchmarks.

 Using XHProf to do profiling locally, using the development environment
 included, I measured the cost of `build_template_part_block_variations` on
 the homepage of Twenty Twenty-four in the 6.4 branch compared with the
 same request in trunk.

 ||        ||= Calls =||= iWT =||= % =||
 ||= 6.4 =||  1  || 14,914 µs|| 5% ||
 ||= trunk =||  0  || N/A || N/A ||

 I'm going to leave this ticket open for the ongoing conversation about
 improvements happening here, but the primary concern of this ticket,
 avoiding the cost of `build_template_part_block_variations` on every
 pageload has been fixed.

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


More information about the wp-trac mailing list