Skip to content

Commit 86dc438

Browse files
committed
Loader: enabled parallel-by-default
- Minor cleanup to parallel: enabled by default, limit of 4 (hard-limit max 12)
1 parent 8d61441 commit 86dc438

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/loader/Loader.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ Phaser.Loader = function (game) {
144144
* If true then parallel downloading will be enabled.
145145
* @property {integer} enableParallel
146146
*/
147-
this.enableParallel = false;
147+
this.enableParallel = true;
148148

149149
/**
150150
* The number of concurrent assets to try and fetch at once.
151-
* Most browsers limit 6 requests per domain.
151+
*
152+
* Many current browsers limit 6 requests per domain; this is slightly conservative.
152153
*
153154
* @property {integer} maxParallelDownloads
154155
* @protected
155156
*/
156-
this.maxParallelDownloads = 6;
157+
this.maxParallelDownloads = 4;
157158

158159
/**
159160
* A counter: if more than zero, files will be automatically added as a synchronization point.
@@ -1175,8 +1176,9 @@ Phaser.Loader.prototype = {
11751176
// When true further non-pack file downloads are suppressed
11761177
var syncblock = false;
11771178

1178-
var inflightLimit = Phaser.Math.clamp(
1179-
this.maxParallelDownloads, 1, this.enableParallel ? 12 : 1);
1179+
var inflightLimit = this.enableParallel
1180+
? Phaser.Math.clamp(this.maxParallelDownloads, 1, 12)
1181+
: 1;
11801182

11811183
for (var i = this._processingHead; i < this._fileList.length; i++)
11821184
{

0 commit comments

Comments
 (0)