resourceloader: Disable ChronologyProtector to speed up wfGetLB()

For load.php requests, Xenon in Wikimedia production measures that half
the time for wfGetLB() is spent in ChronologyProtector::initPositions,
and its query to Memcached.

Change-Id: I24f90897e56fd679c6bd1acf764722ed58e51c67
This commit is contained in:
Timo Tijhof 2016-09-28 21:37:20 +01:00
parent 5e4facec78
commit 98c6743413

View file

@ -23,6 +23,7 @@
*/
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
// This endpoint is supposed to be independent of request cookies and other
// details of the session. Enforce this constraint with respect to session use.
@ -35,6 +36,12 @@ if ( !$wgRequest->checkUrlExtension() ) {
return;
}
// Don't initialise ChronologyProtector from object cache, and
// don't wait for unrelated MediaWiki writes when querying ResourceLoader.
MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
'ChronologyProtection' => 'false',
] );
// Set up ResourceLoader
$resourceLoader = new ResourceLoader(
ConfigFactory::getDefaultInstance()->makeConfig( 'main' ),