Skip to content

Commit

Permalink
Use local caching into getLanguageCodeByStore. Improved indexing perf…
Browse files Browse the repository at this point in the history
…ormances by a factor of 10.
  • Loading branch information
Aurélien FOUCRET committed Feb 2, 2016
1 parent f95ca76 commit 2086c3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/code/community/Smile/ElasticSearch/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ public function getLanguageCodeByLocaleCode($localeCode)
*/
public function getLanguageCodeByStore($store = null)
{
return $this->getLanguageCodeByLocaleCode($this->getLocaleCode($store));
if (!isset($this->_languageCodes[$store->getStoreId()])) {
$this->_languageCodes[$store->getStoreId()] = $this->getLanguageCodeByLocaleCode($this->getLocaleCode($store));
}
return $this->_languageCodes[$store->getStoreId()];
}

/**
Expand Down

0 comments on commit 2086c3d

Please sign in to comment.