From: Ori Livneh Date: Mon, 11 Apr 2016 23:41:57 +0000 (-0700) Subject: Cache first-letter data in APC, if available X-Git-Tag: 1.31.0-rc.0~7318 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=87f4d002cc0151d4bb1dd1c3d9f9e9bec15e706a;p=lhc%2Fweb%2Fwiklou.git Cache first-letter data in APC, if available I noticed that `frwiki:first-letters:fr:fr:4.8.1.1` was at the very top of keys sorted by bandwidth (that is, reqs/sec * size) on one of the memcache servers on WMF prod. The data takes ~60 - 80ms to compute, in case of a cache miss. That's not enough to justify using a tiered cache abstraction here, IMO. Change-Id: If81ce8f86f2c378565f1f6a0dd2c04dee825c4e9 --- diff --git a/includes/collation/IcuCollation.php b/includes/collation/IcuCollation.php index 0aa14065aa..942036b696 100644 --- a/includes/collation/IcuCollation.php +++ b/includes/collation/IcuCollation.php @@ -240,8 +240,8 @@ class IcuCollation extends Collation { return $this->firstLetterData; } - $cache = wfGetCache( CACHE_ANYTHING ); - $cacheKey = wfMemcKey( + $cache = ObjectCache::getLocalServerInstance( CACHE_ANYTHING ); + $cacheKey = $cache->makeKey( 'first-letters', $this->locale, $this->digitTransformLanguage->getCode(),