[wp-trac] [WordPress Trac] #37997: l10n since wp 4.6+

WordPress Trac noreply at wordpress.org
Thu Sep 8 19:59:42 UTC 2016


#37997: l10n since wp 4.6+
--------------------------+-----------------------------
 Reporter:  sharkomatic   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.6
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 When I updated a site to WordPress 4.6, I noticed a dramatic increase in
 function calls to get_locale() in New Relic, which we use to track our
 server and site performance. I believe I have traced the issue to the new
 function _load_textdomain_just_in_time(). In the function description, it
 says that when it first encounters a new textdomain, it will try to load
 translation files from 'wp-content/languages.' The problem is that if no
 translation files exist for that textdomain,
 _load_textdomain_just_in_time() goes through the entire process each time
 it is called because the domain is never being added to the $l10n_unloaded
 array. I added the following line just before line 857 in l10n.php as a
 temporary fix on our site:

 $l10n_unloaded[ $domain ] = true;

 I'm attaching a screenshot of the graph in New Relic that shows the
 increase in function calls and execution time for get_locale() with the
 current _load_textdomain_just_in_time() function code in place. Since
 adding the domain to $l10_unloaded, I have not noticed any performance
 decreases in the site.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37997>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list