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

WordPress Trac noreply at wordpress.org
Mon May 1 21:00:33 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 reporter-feedback  |     Focuses:  performance
-----------------------------------------+------------------------------

Comment (by flixos90):

 @spacedmonkey I just conducted another performance benchmark for your PR
 with the 2023 theme and my data is very different from the one you posted
 above: I don't see any notable difference in performance, all numbers are
 very close to each other, sometimes better or worse so that it's most
 likely only due to remaining variance in the results.

 I used WordPress 6.2's production build for testing. See
 [https://docs.google.com/spreadsheets/d/1-a9qws0lb_ykc3g1TucRfGl6_L8y-
 pU1GMvH_8rlnQA/edit this spreadsheet] for my numbers.

 I don't know if using `glob()` has a benefit over the current approach,
 but based on my data and @joemcgill's feedback above, I'd question it at
 this point. Is there a chance that something specific in your testing
 environment causes this function to be unusually slow? Do you have
 `WP_DEBUG` disabled? Not sure that makes a difference, but just to point
 out one potential caveat.

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


More information about the wp-trac mailing list