After doing a standard install, enabling locale and making 1 request to the frontpage the next request to the frontpage will make 240 calls to ConfigFactory::get(). With the attached patch this drops to 112 - meaning that there are 229 calls to LocaleTranslation::getStringTranslation(). There is also a massive reduction in calls for logged in users.

Comments

alexpott’s picture

StatusFileSize
new1.92 KB
new576 bytes

Fixed typo

gábor hojtsy’s picture

Issue tags: +language-ui

The change looks good. The setting is more meaning we SHOULD translate English (from a code point of view it means we *need* to look up the translation in case it is there). From a user point of view, it is indeed about CAN translate English. Anyway, this is minor nitpicking since the patch looks good :)

vijaycs85’s picture

+++ b/core/modules/locale/lib/Drupal/locale/LocaleTranslation.php
@@ -100,9 +106,23 @@ public function getStringTranslation($langcode, $string, $context) {
+    $this->translateEnglish = NULL;

very minor: unset($this->translateEnglish); would be much better as this is a bool property and we are trying to reset it.

gábor hojtsy’s picture

Status: Needs review » Needs work

Needs work on the above, but mostly looks good :)

gábor hojtsy’s picture

Issue tags: +sprint
benjy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.92 KB
new533 bytes

Re-rolled with #3 fixed.

Status: Needs review » Needs work

The last submitted patch, 6: 2202143_6.patch, failed testing.

benjy’s picture

6: 2202143_6.patch queued for re-testing.

benjy’s picture

Status: Needs work » Needs review
vijaycs85’s picture

Status: Needs review » Reviewed & tested by the community

looks good.

yesct’s picture

6: 2202143_6.patch queued for re-testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Yay, performance!

Committed and pushed to 8.x. Thanks!

gábor hojtsy’s picture

Issue tags: -sprint

Yay, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.