Title: [Plugin: Polylang] load_textdomain performance
Last modified: August 20, 2016

---

# [Plugin: Polylang] load_textdomain performance

 *  [QuickeneR](https://wordpress.org/support/users/quickener/)
 * (@quickener)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-polylang-load_textdomain-performance/)
 * Hi,
    I’m trying to speed up a copy of WordPress that runs locally on an old (
   Celeron 2GHz, 600MB RAM) but otherwise idle “server”. With polylang disabled,
   the main html is loaded in about 0.5 sec, while with polylang enabled the time
   is 1.2 sec.
 * I tried some profiling with xdebug and found that a lot of time is spent by function
   load_textdomain(). A bit of googling showed that it basically loads the translations
   for various messages that WordPress might generate.
 * I’m using WordPress as a sort of mini CMS with blog functionality reduced to 
   posting news. The comments and other blog-like features are disabled, so it does
   not really need to say to the site visitors things like “please log in” or “your
   comment was added” or whatever. Just show a page or a post. So, I went to polylang/
   include/core.php line 325 and commented it out
    # load_textdomain( $textdomain[‘
   domain’], str_replace($this->default_locale, $new_locale, $textdomain[‘mo’]));
 * The load time shrank to 0.6 seconds. The only things that broke (that I noticed)
   were the strings from Settings-Languages-Strings translation, like the site title.
   Everything else seems to work as before.
 * Do I miss anything? Will it break some internal logic if I leave that line commented
   out? Is it needed at least for the dashboard?
 * Thanks.
 * [http://wordpress.org/extend/plugins/polylang/](http://wordpress.org/extend/plugins/polylang/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-polylang-load_textdomain-performance/#post-3124087)
 * This line loads the language files for WordPress, your theme and all your plugins
   in the correct language. No file is loaded when you use the default language (
   en_US)
 * You just discovered one of the known weaknesses of WordPress. Loading the languages
   files is a very expensive process.
 * Things already improved a lot with WP 3.4 but there are still possible improvements.
   See also
    [http://core.trac.wordpress.org/ticket/17128](http://core.trac.wordpress.org/ticket/17128)
   [http://core.trac.wordpress.org/ticket/19852](http://core.trac.wordpress.org/ticket/19852)

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Polylang] load_textdomain performance’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-polylang-load_textdomain-performance/#post-3124087)
 * Status: not resolved