[wp-trac] [WordPress Trac] #58196: Improve performance of `_get_block_templates_paths`

WordPress Trac noreply at wordpress.org
Thu Sep 21 18:51:52 UTC 2023


#58196: Improve performance of `_get_block_templates_paths`
-----------------------------------------+-----------------------------
 Reporter:  spacedmonkey                 |       Owner:  thekt12
     Type:  enhancement                  |      Status:  assigned
 Priority:  normal                       |   Milestone:  Future Release
Component:  Themes                       |     Version:  5.9
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:  performance
-----------------------------------------+-----------------------------

Comment (by joemcgill):

 @spacedmonkey and @thekt12, this function is still being used in
 `_get_block_templates_files()` ([https://github.com/WordPress/wordpress-
 develop/blob/58d47f5c809410dd0ed3279f41b1bf2d006ea53d/src/wp-includes
 /block-template-utils.php#L336 reference]).

 In a recent profiling run I conducted, I can see it getting called 3 times
 during a pageload, and while the parent function
 (`_get_block_templates_files()` has a significant impact on server
 performance, `_get_block_template_paths()` doesn't seem to have much
 impact at all, so I think it's fine to deprioritize this.

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


More information about the wp-trac mailing list