Loader: enabled parallel-by-default

- Minor cleanup to parallel: enabled by default, limit of 4 (hard-limit
  max 12)
This commit is contained in:
Paul 2015-02-08 19:42:34 -08:00
parent 8d61441844
commit 86dc43874c

View file

@ -144,16 +144,17 @@ Phaser.Loader = function (game) {
* If true then parallel downloading will be enabled.
* @property {integer} enableParallel
*/
this.enableParallel = false;
this.enableParallel = true;
/**
* The number of concurrent assets to try and fetch at once.
* Most browsers limit 6 requests per domain.
*
* Many current browsers limit 6 requests per domain; this is slightly conservative.
*
* @property {integer} maxParallelDownloads
* @protected
*/
this.maxParallelDownloads = 6;
this.maxParallelDownloads = 4;
/**
* A counter: if more than zero, files will be automatically added as a synchronization point.
@ -1175,8 +1176,9 @@ Phaser.Loader.prototype = {
// When true further non-pack file downloads are suppressed
var syncblock = false;
var inflightLimit = Phaser.Math.clamp(
this.maxParallelDownloads, 1, this.enableParallel ? 12 : 1);
var inflightLimit = this.enableParallel
? Phaser.Math.clamp(this.maxParallelDownloads, 1, 12)
: 1;
for (var i = this._processingHead; i < this._fileList.length; i++)
{