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

WordPress Trac noreply at wordpress.org
Wed Dec 20 20:00:21 UTC 2023


#58196: Improve performance of `_get_block_templates_paths`
-----------------------------------------+--------------------------
 Reporter:  spacedmonkey                 |       Owner:  thekt12
     Type:  enhancement                  |      Status:  closed
 Priority:  normal                       |   Milestone:  6.5
Component:  Themes                       |     Version:  5.9
 Severity:  normal                       |  Resolution:  fixed
 Keywords:  has-patch reporter-feedback  |     Focuses:  performance
-----------------------------------------+--------------------------
Changes (by joemcgill):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"57215" 57215]:
 {{{
 #!CommitTicketReference repository="" revision="57215"
 Themes: Improve the performance of `_get_block_templates_paths`.

 This avoids redundant recursive lookups for block template paths in the
 same base directory by implementing a static cache. It also replaces an
 potentially expensive `file_exists` call in favor of doing recursive
 iteration of files inside a try/catch block.

 Props thekt12, spacedmonkey, flixos90, mukesh27, joemcgill.
 Fixes #58196.
 }}}

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


More information about the wp-trac mailing list