From 458e7cabbbafda81c35cf8270a8393f3fa3f29ad Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Tue, 12 May 2015 20:45:01 -0700 Subject: [PATCH] ResourceLoader::filter: use APC when running under HHVM On HHVM, (a) the cost of a ResourceLoader::filter cache miss is smaller, and (b) APC is faster and more resilient than PHP's. These two things tilt the scales in favor of using APC rather than Memcached. Change-Id: I30b490e5bc815849d4b0bb06f2dbbb68825ed225 --- includes/resourceloader/ResourceLoader.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index b4b5a2e2c2..ccc7a1796a 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -195,9 +195,8 @@ class ResourceLoader { if ( !$options['cache'] ) { $result = $this->applyFilter( $filter, $data ); } else { - // Use CACHE_ANYTHING since filtering is very slow compared to DB queries $key = wfMemcKey( 'resourceloader', 'filter', $filter, self::$filterCacheVersion, md5( $data ) ); - $cache = wfGetCache( CACHE_ANYTHING ); + $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING ); $cacheEntry = $cache->get( $key ); if ( is_string( $cacheEntry ) ) { wfIncrStats( "rl-$filter-cache-hits" ); -- 2.20.1