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

WordPress Trac noreply at wordpress.org
Fri Apr 28 15:37:58 UTC 2023


#58196: Improve performance of `_get_block_templates_paths`
--------------------------+------------------------------
 Reporter:  spacedmonkey  |       Owner:  (none)
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+------------------------------

Comment (by spacedmonkey):

 Replying to [comment:3 johnbillion]:
 > Do you know the technical reason that recursive globbing (nearly wrote
 blogging there) is faster than using the filesystem iterator classes? It
 would be good to know for a full understanding and for future reference.

 It is a recursive lookup. The glob, looks for nested directory and if it
 is not found, then it returns early.

 After a rethink here.  A simpler approach would be to add a cache see
 [https://github.com/WordPress/wordpress-develop/pull/4397 #4397].

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


More information about the wp-trac mailing list