[wp-trac] [WordPress Trac] #57077: Performance issues in `_add_block_template_info`

WordPress Trac noreply at wordpress.org
Tue Nov 15 10:56:35 UTC 2022


#57077: Performance issues in `_add_block_template_info`
--------------------------+--------------------------
 Reporter:  spacedmonkey  |       Owner:  (none)
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  6.1.1
Component:  Themes        |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------

Comment (by spacedmonkey):

 In [https://github.com/WordPress/wordpress-develop/pull/3624 #3624], we
 see a 1/4  or 1/5 of the page load time disappear. Why does this happen?

 Getting theme data, happens many times, including on getting template
 parts in block themes. This means that the theme_json_resolver class is
 called 100s of times. Without a cache, the same values are called 100s of
 times. In theme and supports data is generated just once and cached in a
 class property. As theme supports, also includes many calls to
 get_options, to get thumbnail sizes, it also means many less calls to
 database / caches.

 I think this is an important change and one that needs to go into core
 ASAP, as this performance benefits are clear and will effect UX.

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


More information about the wp-trac mailing list