[wp-trac] [WordPress Trac] #51678: [5.6 Beta] Performance regression with i10n changes when translations files are not present

WordPress Trac noreply at wordpress.org
Fri Nov 6 13:21:24 UTC 2020


#51678: [5.6 Beta] Performance regression with i10n changes when translations files
are not present
-------------------------------------------------+-------------------------
 Reporter:  vedjain                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  high                                 |   Milestone:  5.6
Component:  I18N                                 |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing dev-feedback needs-    |     Focuses:
  patch                                          |  performance
-------------------------------------------------+-------------------------
Changes (by peterfabian1000):

 * keywords:  needs-testing dev-feedback has-patch => needs-testing dev-
     feedback needs-patch


Comment:

 Hi folks. As Rodrigo and Vedanshu mentioned in Slack and in this ticket,
 this has rather large impact on WooCommerce (and potentially anything that
 uses multiple requests to build a page).

 I did a coarse benchmark and compared 5.5.3, 5.6-beta3 and I can see quite
 large difference, as you can see in the screenshot, two bottom rectangles:
 https://cloudup.com/cnW7jCJgzxN. The slowest request in 5.5.3 took about
 1.87s, while in 5.6-beta3 it's 11.66s.

 Part of it could be our fault and how we use translations strings, but I
 think more plugins will probably face the same issue.

 I've tried to create a POC with WP_Textdomain_Registry caching also on
 locale-level, it's linked to GH now, I think. I've also tested how it
 performs and you can see the results in the same screenshot, first
 rectangle shows load times with the early exit within `is_readable`, the
 second one is the same POC code, but without the early exit.

 To have a more exact number, I also counted the calls to load_textdomain()
 and I got the following numbers on loading WC home:
 - without early exit: 112992 calls
 - with early exit: 83 calls

 Hope it helps in pushing this problem to resolution. Thanks!

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


More information about the wp-trac mailing list