From: Ori.livneh Date: Mon, 25 Nov 2013 07:04:29 +0000 (+0000) Subject: Remove experiment code for moduleStorage X-Git-Tag: 1.31.0-rc.0~17883^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=a53097e41c75c71fd86dfc0b992104e39d4fbd1e;p=lhc%2Fweb%2Fwiklou.git Remove experiment code for moduleStorage This reverts changes I51cfd5637 and Id2835eca4. We got all the data we needed. Results (and, hopefully, the full dataset) will be publicized within two weeks. Bug: 56397 Change-Id: Id39d4457a9b21c4e53e976cd3995c910a7d7031b --- diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 8a8215d192..724ca5e814 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -1749,38 +1749,6 @@ var mw = ( function ( $, undefined ) { // Cache hit stats stats: { hits: 0, misses: 0, expired: 0 }, - // Experiment data - experiment: ( function () { - var start = ( new Date() ).getTime(), id = 0, seed = 0; - - try { - id = JSON.parse( localStorage.getItem( 'moduleStorageExperiment' ) ); - if ( typeof id !== 'number' ) { - id = Math.floor( Math.random() * Math.random() * 1e16 ); - localStorage.setItem( 'moduleStorageExperiment', id ); - } - seed = id % 2000; - } catch ( e ) {} - - return { - // Unique identifier for this browser. This allows us to group all - // datapoints generated by a particular browser, which in turn allows us - // to see how the initial load compares to subsequent page loads. - id: id, - - // Group assignment may be 0 (not in experiment), 1 (control group), or 2 - // (experimental group). Browsers that don't implement all the prerequisite APIs - // (JSON and Web Storage) are ineligible. Eligible browsers have a 0.1% chance - // of being included in the experiment, in which case they are equally likely to - // be assigned to either the experimental or control group. - group: seed === 1 ? 1 : ( seed === 2 ? 2 : 0 ), - - // Assess module storage performance by measuring the time between this - // reference point and the window load event. - start: start - }; - }() ), - /** * Construct a JSON-serializable object representing the content of the store. * @return {Object} Module store contents. @@ -1838,12 +1806,9 @@ var mw = ( function ( $, undefined ) { return; } - if ( - // We're in debug mode - mw.config.get( 'debug' ) || - // Module storage is neither enabled by default, nor enabled for this user's group. - !( mw.config.get( 'wgResourceLoaderStorageEnabled' ) || mw.loader.store.experiment.group === 2 ) - ) { + if ( !mw.config.get( 'wgResourceLoaderStorageEnabled' ) || mw.config.get( 'debug' ) ) { + // Disabled by configuration, or because debug mode is set. + mw.loader.store.enabled = false; return; }