[wp-trac] [WordPress Trac] #59583: Patterns: `theme` attribute not inserted in Template Part blocks
WordPress Trac
noreply at wordpress.org
Wed Oct 11 18:35:13 UTC 2023
#59583: Patterns: `theme` attribute not inserted in Template Part blocks
--------------------------------------+------------------------------
Reporter: Bernhard Reiter | Owner: Bernhard Reiter
Type: defect (bug) | Status: reopened
Priority: high | Milestone: 6.4
Component: General | Version:
Severity: major | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+------------------------------
Comment (by flixos90):
@bernhard-reiter @gziolo I have spent some time researching this further
in terms of performance impact. Here is my summary / conclusion:
* [56805] seemed to have a massive performance impact (in my benchmarks,
`wp-total` improved from ~105ms to ~85ms for TT4).
* However it introduced a functional bug, which [56818] then addressed,
while however also reverting almost all the performance benefit.
* The solution implemented in
https://github.com/WordPress/gutenberg/pull/55217 and
https://github.com/WordPress/wordpress-develop/pull/5455 improves
performance again slightly, however ''far'' from how [56805] initially
seemed to do (`wp-total` 102.5ms vs 103.8ms in my current benchmark with
TT4)
* Unfortunately, the apparent performance enhancement [56805] came almost
entirely from the bug it introduced. Due to no longer injecting the
`theme` attribute to all `core/template-part` blocks, those blocks would
no run any of the logic within
https://github.com/WordPress/gutenberg/pull/55217/files#diff-
28f36bb64fbbc8ce728db401b1e4cf30c9f44db7f5dcce1b7b0cc9ce60b1a209L22, which
has a considerable cost.
* This led us to believe there was a major performance improvement behind
the change, but unfortunately most of it came from the bug.
* I think it is worth completing the work on
https://github.com/WordPress/gutenberg/pull/55217 and
https://github.com/WordPress/wordpress-develop/pull/5455, since they bring
a decent performance improvement. However, the greater part of the
associated cost comes from retrieving the file contents from block
template part files (and block template files), for which I have
identified a separate solution in a new ticket #59600. The PR on that
ticket leads to performance improvements between 5-10% for all block
themes I've tested it with so far.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59583#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list