[wp-trac] [WordPress Trac] #55595: Consider only registering widgets on themes that supports widgets

WordPress Trac noreply at wordpress.org
Tue Dec 5 15:21:48 UTC 2023


#55595: Consider only registering widgets on themes that supports widgets
-------------------------------+--------------------------
 Reporter:  spacedmonkey       |       Owner:  pereirinha
     Type:  enhancement        |      Status:  assigned
 Priority:  normal             |   Milestone:  6.5
Component:  Widgets            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  needs-patch close  |     Focuses:  performance
-------------------------------+--------------------------
Changes (by joemcgill):

 * keywords:  needs-patch => needs-patch close


Comment:

 I spent a little time reviewing the potential performance benefit of not
 registering widgets and am not seeing a huge performance impact for the
 actual registration of widgets. Looking back at
 [https://docs.google.com/spreadsheets/d/1WICTFAn2pOeVlYgpBzLU8Uh-
 77zQF3_ZO3N97LLlVdU/edit#gid=802202677 the profiling data] I collected
 when profiling WP 6.3, `wp_widgets_init` accounts for a very small
 inclusive wall time (IWT):

 * Twenty Twenty-one (home) – 0.61% IWT
 * Twenty Twenty-three (home) – 0.87% IWT

 Similarly,
 [https://app.blackfire.io/profiles/48bf6635-88c1-41d9-ae40-beb01b420885/graph?settings%5Bdimension%5D=wt&settings%5Bdisplay%5D=focused&settings%5BtabPane%5D=nodes&selected=wp_widgets_init&callname=wp_widgets_init&constraintDoc=
 a recent profile] of Twenty Twenty-four on WP 6.4 shows this only takes
 0.8% IWT.

 In the [https://make.wordpress.org/core/2023/05/25/wordpress-6-2-server-
 performance-analysis-summary/ WP 6.2 profiling analysis] we noticed that
 rendering widgets (i.e., `WP_Widget::display_callback` had a significant
 performance cost, but is only relevant when a site has widgets to display,
 and is additionally dependent on which widgets are being rendered. For
 example, the core categories block used in the category list widget was
 responsible for 5–10% of the total IWT during the 6.2 performance
 analysis.

 Unless there is an additional factor I'm missing, I'm thinking we could
 consider closing this and focusing effort on how widgets are rendered
 instead.

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


More information about the wp-trac mailing list