[wp-trac] [WordPress Trac] #40731: locate_template() performance improvement

WordPress Trac noreply at wordpress.org
Sun Jun 18 13:47:43 UTC 2017


#40731: locate_template() performance improvement
-----------------------------------------+---------------------------------
 Reporter:  danielhuesken                |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Themes                       |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:  template,
                                         |  performance
-----------------------------------------+---------------------------------

Comment (by danielhuesken):

 Yes. If you have the same template for a post and you have a post list,
 that the template will be located every time again and the file_exists()
 calls will be many.

 In our case we have WooCommerce and Products and in the product a plugin
 will do many things with templates that must be located every time again,
 with the expensive file_exits(). On that project is a page where the load
 will be increased by 1.5 seconds with this change.

 I could see the calls in a xdebug profile.

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


More information about the wp-trac mailing list