From 5268aec9da59041a5c5befeafba1e6f5f4628f00 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Wed, 14 Jan 2026 14:44:24 +0100 Subject: [PATCH 1/5] cleanup --- JetStreamDriver.js | 243 ++++++++++++++++++++++++++++++-------------- tests/unit-tests.js | 6 +- 2 files changed, 167 insertions(+), 82 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index db875b3e..9798185a 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -56,25 +56,6 @@ function displayCategoryScores() { document.body.classList.add("details"); } -function getIterationCount(plan) { - if (plan.name in JetStreamParams.testIterationCountMap) - return JetStreamParams.testIterationCountMap[plan.name]; - if (JetStreamParams.testIterationCount) - return JetStreamParams.testIterationCount; - if (plan.iterations) - return plan.iterations; - return defaultIterationCount; -} - -function getWorstCaseCount(plan) { - if (plan.name in JetStreamParams.testWorstCaseCountMap) - return JetStreamParams.testWorstCaseCountMap[plan.name]; - if (JetStreamParams.testWorstCaseCount) - return JetStreamParams.testWorstCaseCount; - if (plan.worstCaseCount !== undefined) - return plan.worstCaseCount; - return defaultWorstCaseCount; -} if (isInBrowser) { document.onkeydown = (keyboardEvent) => { @@ -347,7 +328,7 @@ class Driver { this.errors = []; // Make benchmark list unique and sort it. this.benchmarks = Array.from(new Set(benchmarks)); - this.benchmarks.sort((a, b) => a.plan.name.toLowerCase() < b.plan.name.toLowerCase() ? 1 : -1); + this.benchmarks.sort((a, b) => a.name.toLowerCase() < b.name.toLowerCase() ? 1 : -1); console.assert(this.benchmarks.length, "No benchmarks selected"); this.counter = { }; this.counter.loadedResources = 0; @@ -521,7 +502,7 @@ class Driver { if (isInBrowser) window.addEventListener("error", (e) => this.pushError("driver startup", e.error)); await this.prefetchResources(); - this.benchmarks.sort((a, b) => a.plan.name.toLowerCase() < b.plan.name.toLowerCase() ? 1 : -1); + this.benchmarks.sort((a, b) => a.name.toLowerCase() < b.name.toLowerCase() ? 1 : -1); if (isInBrowser) this.prepareBrowserUI(); this.isReady = true; @@ -868,21 +849,45 @@ class BrowserScripts extends Scripts { class Benchmark { - constructor(plan) - { - this.plan = plan; - this.tags = this.processTags(plan.tags) - this.iterations = getIterationCount(plan); - this.isAsync = !!plan.isAsync; - this.allowUtf16 = !!plan.allowUtf16; - this.scripts = null; - this.preloads = []; - this.shellPrefetchedResources = null; - this.results = []; + constructor({ + name, + files, + preload = {}, + tags, + iterations, + deterministicRandom = false, + exposeBrowserTest = false, + allowUtf16 = false, + args = {} }) { this._state = BenchmarkState.READY; + this.results = []; + + this.name = name + this.tags = this._processTags(tags) + this._arguments = args; + + this.iterations = this._processIterationCount(iterations); + this._deterministicRandom = deterministicRandom; + this._exposeBrowserTest = exposeBrowserTest; + this.allowUtf16 = !!allowUtf16; + + // Resource handling: + this._scripts = null; + this._files = files; + this._preloadEntries = Object.entries(preload); + this._preloadBlobData = []; + this._shellPrefetchedResources = null; + } + + // Use getter so it can be overridden in subclasses (GroupedBenchmark). + get files() { + return this._files; + } + get preloadEntries() { + return this._preloadEntries; } - processTags(rawTags) { + _processTags(rawTags) { const tags = new Set(rawTags.map(each => each.toLowerCase())); if (tags.size != rawTags.length) throw new Error(`${this.name} got duplicate tags: ${rawTags.join()}`); @@ -892,8 +897,34 @@ class Benchmark { return tags; } +<<<<<<< HEAD + get name() { return this.plan.name; } + get files() { return this.plan.files; } +||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) get name() { return this.plan.name; } get files() { return this.plan.files; } + get preloadFiles() { return Object.values(this.plan.preload ?? {}); } +======= + _processIterationCount(iterations) { + if (this.name in JetStreamParams.testIterationCountMap) + return JetStreamParams.testIterationCountMap[this.name]; + if (JetStreamParams.testIterationCount) + return JetStreamParams.testIterationCount; + if (iterations) + return iterations; + return defaultIterationCount; + } + + _processWorstCaseCount(worstCaseCount) { + if (this.name in JetStreamParams.testWorstCaseCountMap) + return JetStreamParams.testWorstCaseCountMap[plan.name]; + if (JetStreamParams.testWorstCaseCount) + return JetStreamParams.testWorstCaseCount; + if (worstCaseCount !== undefined) + return worstCaseCount; + return defaultWorstCaseCount; + } +>>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) get isDone() { return this._state == BenchmarkState.DONE || this._state == BenchmarkState.ERROR; @@ -906,7 +937,7 @@ class Benchmark { get benchmarkArguments() { return { - ...this.plan.arguments, + ...this._arguments, iterationCount: this.iterations, }; } @@ -983,7 +1014,7 @@ class Benchmark { get preIterationCode() { let code = this.prepareForNextIterationCode ; - if (this.plan.deterministicRandom) + if (this._deterministicRandom) code += `Math.random.__resetSeed();`; if (JetStreamParams.customPreIterationCode) @@ -1044,15 +1075,17 @@ class Benchmark { globalThis?.gc(); } - const scripts = isInBrowser ? new BrowserScripts(this.preloads) : new ShellScripts(this.preloads); + const scripts = isInBrowser ? + new BrowserScripts(this._preloadBlobData) : + new ShellScripts(this._preloadBlobData); - if (!!this.plan.deterministicRandom) + if (this._deterministicRandom) scripts.addDeterministicRandom() - if (!!this.plan.exposeBrowserTest) + if (this._exposeBrowserTest) scripts.addBrowserTest(); - if (this.shellPrefetchedResources) { - scripts.addPrefetchedResources(this.shellPrefetchedResources); + if (this._shellPrefetchedResources) { + scripts.addPrefetchedResources(this._shellPrefetchedResources); } const prerunCode = this.prerunCode; @@ -1060,8 +1093,16 @@ class Benchmark { scripts.add(prerunCode); if (!isInBrowser) { +<<<<<<< HEAD console.assert(this.scripts && this.scripts.length === this.plan.files.length); for (const text of this.scripts) +||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) + console.assert(this.scripts && this.scripts.length === this.files.length); + for (const text of this.scripts) +======= + console.assert(this._scripts && this._scripts.length === this.files.length); + for (const text of this._scripts) +>>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) scripts.add(text); } else { const cache = browserFileLoader.blobDataCache; @@ -1116,13 +1157,32 @@ class Benchmark { } +<<<<<<< HEAD updateCounter() { const counter = JetStream.counter; ++counter.loadedResources; const statusElement = document.getElementById("status"); statusElement.innerHTML = `Loading ${counter.loadedResources} of ${counter.totalResources} ...`; +||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) + async prefetchResourcesForBrowser() { + console.assert(isInBrowser); + const promises = this.files.map((file) => browserFileLoader.prefetchResourceFile(file)); + for (const [name, resource] of Object.entries(this.plan.preload ?? {})) { + promises.push(this.prefetchResourcePreload(name, resource)); + } + await Promise.all(promises); +======= + async prefetchResourcesForBrowser() { + console.assert(isInBrowser); + const promises = this.files.map((file) => browserFileLoader.prefetchResourceFile(file)); + for (const [name, resource] of this.preloadEntries) { + promises.push(this.prefetchResourcePreload(name, resource)); + } + await Promise.all(promises); +>>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) } +<<<<<<< HEAD prefetchResourcesForBrowser(counter) { console.assert(isInBrowser); @@ -1174,21 +1234,35 @@ class Benchmark { } } return !counter.failedPreloadResources && counter.loadedResources == counter.totalResources; +||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) + async prefetchResourcePreload(name, resource) { + const preloadData = await browserFileLoader.prefetchResourcePreload(name, resource); + this.preloads.push(preloadData); +======= + async prefetchResourcePreload(name, resource) { + const preloadData = await browserFileLoader.prefetchResourcePreload(name, resource); + this._preloadBlobData.push(preloadData); +>>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) } prefetchResourcesForShell() { // FIXME: move to ShellFileLoader. console.assert(!isInBrowser); +<<<<<<< HEAD console.assert(this.scripts === null, "This initialization should be called only once."); this.scripts = this.plan.files.map(file => shellFileLoader.load(file)); - - console.assert(this.preloads.length === 0, "This initialization should be called only once."); - this.shellPrefetchedResources = Object.create(null); - if (!this.plan.preload) { - return; - } - for (let [name, resource] of Object.entries(this.plan.preload)) { +||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) + console.assert(this.scripts === null, "This initialization should be called only once."); + this.scripts = this.files.map(file => shellFileLoader.load(file)); +======= + console.assert(this._scripts === null, "This initialization should be called only once."); + this._scripts = this.files.map(file => shellFileLoader.load(file)); +>>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) + + console.assert(this._preloadBlobData.length === 0, "This initialization should be called only once."); + this._shellPrefetchedResources = Object.create(null); + for (let [name, resource] of this.preloadEntries) { const compressed = isCompressed(resource); if (compressed && !JetStreamParams.prefetchResources) { resource = uncompressedName(resource); @@ -1199,10 +1273,10 @@ class Benchmark { if (compressed) { bytes = zlib.decompress(bytes); } - this.shellPrefetchedResources[resource] = bytes; + this._shellPrefetchedResources[resource] = bytes; } - this.preloads.push({ name, resource, blobURLOrPath: resource }); + this._preloadBlobData.push({ name, resource, blobURLOrPath: resource }); } } @@ -1318,6 +1392,25 @@ class Benchmark { } plotContainer.innerHTML = `${circlesSVG}`; } +<<<<<<< HEAD +||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) + + tearDown() { + if (isInBrowser) { + browserFileLoader.free(this.files); + browserFileLoader.free(this.preloadFiles); + } + } +======= + + tearDown() { + if (isInBrowser) { + browserFileLoader.free(this.files); + const preloadFiles = this.preloadEntries.map(([_, file]) => file); + browserFileLoader.free(preloadFiles); + } + } +>>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) }; class GroupedBenchmark extends Benchmark { @@ -1368,10 +1461,11 @@ class GroupedBenchmark extends Benchmark { } get files() { - let files = []; - for (const benchmark of this.benchmarks) - files = files.concat(benchmark.files); - return files; + return this.benchmarks.flatMap(benchmark => benchmark.files) + } + + get preloadEntries() { + return this.benchmarks.flatMap(benchmark => benchmark.preloadEntries) } async run() { @@ -1445,10 +1539,10 @@ class GroupedBenchmark extends Benchmark { }; class DefaultBenchmark extends Benchmark { - constructor(...args) { - super(...args); + constructor({worstCaseCount, ...args}) { + super(args); - this.worstCaseCount = getWorstCaseCount(this.plan); + this.worstCaseCount = this._processWorstCaseCount(worstCaseCount); this.firstIterationTime = null; this.firstIterationScore = null; this.worstTime = null; @@ -1629,8 +1723,8 @@ class WasmEMCCBenchmark extends AsyncBenchmark { }; class WSLBenchmark extends Benchmark { - constructor(...args) { - super(...args); + constructor(plan) { + super(plan); this.stdlibTime = null; this.stdlibScore = null; @@ -1692,10 +1786,9 @@ class WSLBenchmark extends Benchmark { } }; -class WasmLegacyBenchmark extends Benchmark { - constructor(...args) { - super(...args); - +class AsyncWasmLegacyBenchmark extends Benchmark { + constructor(plan) { + super(plan); this.startupTime = null; this.startupScore = null; this.runTime = null; @@ -1798,19 +1891,15 @@ class WasmLegacyBenchmark extends Benchmark { str += "};\n"; let preloadCount = 0; - for (const [name, resource] of Object.entries(this.plan.preload)) { + for (const [name, resource] of this.preloadEntries) { preloadCount++; str += `JetStream.loadBlob(${JSON.stringify(name)}, "${resource}", () => {\n`; } - if (this.plan.async) { - str += `doRun().catch((e) => { - console.log("error running wasm:", e); - console.log(e.stack) - throw e; - });`; - } else { - str += `doRun();` - } + str += `doRun().catch((e) => { + console.log("error running wasm:", e); + console.log(e.stack) + throw e; + });`; for (let i = 0; i < preloadCount; ++i) { str += `})`; } @@ -2603,7 +2692,7 @@ let BENCHMARKS = [ allowUtf16: true, tags: ["Wasm", "transformersjs"], }), - new WasmLegacyBenchmark({ + new AsyncWasmLegacyBenchmark({ name: "tfjs-wasm", files: [ "./wasm/tfjs-model-helpers.js", @@ -2619,13 +2708,12 @@ let BENCHMARKS = [ preload: { tfjsBackendWasmBlob: "./wasm/tfjs-backend-wasm.wasm", }, - async: true, deterministicRandom: true, exposeBrowserTest: true, allowUtf16: true, tags: ["Wasm"], }), - new WasmLegacyBenchmark({ + new AsyncWasmLegacyBenchmark({ name: "tfjs-wasm-simd", files: [ "./wasm/tfjs-model-helpers.js", @@ -2641,7 +2729,6 @@ let BENCHMARKS = [ preload: { tfjsBackendWasmSimdBlob: "./wasm/tfjs-backend-wasm-simd.wasm", }, - async: true, deterministicRandom: true, exposeBrowserTest: true, allowUtf16: true, @@ -2671,7 +2758,7 @@ let BENCHMARKS = [ preload: { BUNDLE: "./babylonjs/dist/bundle.es5.min.js", }, - arguments: { + args: { expectedCacheCommentCount: 23988, }, tags: ["startup", "js", "class", "es5", "babylonjs"], @@ -2686,7 +2773,7 @@ let BENCHMARKS = [ preload: { BUNDLE: "./babylonjs/dist/bundle.es6.min.js", }, - arguments: { + args: { expectedCacheCommentCount: 21222, }, tags: ["Default", "js", "startup", "class", "es6", "babylonjs"], diff --git a/tests/unit-tests.js b/tests/unit-tests.js index 3d50ec42..50c073d5 100644 --- a/tests/unit-tests.js +++ b/tests/unit-tests.js @@ -186,10 +186,8 @@ function assertThrows(message, func) { checkFile(benchmark.name, file, "file"); } - if (benchmark.plan.preload) { - for (const [name, file] of Object.entries(benchmark.plan.preload)) { - checkFile(benchmark.name, file, `preload.${name}`); - } + for (const [name, file] of benchmark.preloadEntries) { + checkFile(benchmark.name, file, `preload.${name}`); } } })(); From bcb746ed29802eb59357311bebc32539abcd83ca Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 19 Jan 2026 14:38:05 +0100 Subject: [PATCH 2/5] cleanup --- JetStreamDriver.js | 72 ---------------------------------------------- 1 file changed, 72 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 9798185a..62b1fa26 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -897,14 +897,6 @@ class Benchmark { return tags; } -<<<<<<< HEAD - get name() { return this.plan.name; } - get files() { return this.plan.files; } -||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) - get name() { return this.plan.name; } - get files() { return this.plan.files; } - get preloadFiles() { return Object.values(this.plan.preload ?? {}); } -======= _processIterationCount(iterations) { if (this.name in JetStreamParams.testIterationCountMap) return JetStreamParams.testIterationCountMap[this.name]; @@ -924,7 +916,6 @@ class Benchmark { return worstCaseCount; return defaultWorstCaseCount; } ->>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) get isDone() { return this._state == BenchmarkState.DONE || this._state == BenchmarkState.ERROR; @@ -1093,16 +1084,8 @@ class Benchmark { scripts.add(prerunCode); if (!isInBrowser) { -<<<<<<< HEAD - console.assert(this.scripts && this.scripts.length === this.plan.files.length); - for (const text of this.scripts) -||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) - console.assert(this.scripts && this.scripts.length === this.files.length); - for (const text of this.scripts) -======= console.assert(this._scripts && this._scripts.length === this.files.length); for (const text of this._scripts) ->>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) scripts.add(text); } else { const cache = browserFileLoader.blobDataCache; @@ -1157,32 +1140,13 @@ class Benchmark { } -<<<<<<< HEAD updateCounter() { const counter = JetStream.counter; ++counter.loadedResources; const statusElement = document.getElementById("status"); statusElement.innerHTML = `Loading ${counter.loadedResources} of ${counter.totalResources} ...`; -||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) - async prefetchResourcesForBrowser() { - console.assert(isInBrowser); - const promises = this.files.map((file) => browserFileLoader.prefetchResourceFile(file)); - for (const [name, resource] of Object.entries(this.plan.preload ?? {})) { - promises.push(this.prefetchResourcePreload(name, resource)); - } - await Promise.all(promises); -======= - async prefetchResourcesForBrowser() { - console.assert(isInBrowser); - const promises = this.files.map((file) => browserFileLoader.prefetchResourceFile(file)); - for (const [name, resource] of this.preloadEntries) { - promises.push(this.prefetchResourcePreload(name, resource)); - } - await Promise.all(promises); ->>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) } -<<<<<<< HEAD prefetchResourcesForBrowser(counter) { console.assert(isInBrowser); @@ -1234,31 +1198,14 @@ class Benchmark { } } return !counter.failedPreloadResources && counter.loadedResources == counter.totalResources; -||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) - async prefetchResourcePreload(name, resource) { - const preloadData = await browserFileLoader.prefetchResourcePreload(name, resource); - this.preloads.push(preloadData); -======= - async prefetchResourcePreload(name, resource) { - const preloadData = await browserFileLoader.prefetchResourcePreload(name, resource); - this._preloadBlobData.push(preloadData); ->>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) } prefetchResourcesForShell() { // FIXME: move to ShellFileLoader. console.assert(!isInBrowser); -<<<<<<< HEAD - console.assert(this.scripts === null, "This initialization should be called only once."); - this.scripts = this.plan.files.map(file => shellFileLoader.load(file)); -||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) - console.assert(this.scripts === null, "This initialization should be called only once."); - this.scripts = this.files.map(file => shellFileLoader.load(file)); -======= console.assert(this._scripts === null, "This initialization should be called only once."); this._scripts = this.files.map(file => shellFileLoader.load(file)); ->>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) console.assert(this._preloadBlobData.length === 0, "This initialization should be called only once."); this._shellPrefetchedResources = Object.create(null); @@ -1392,25 +1339,6 @@ class Benchmark { } plotContainer.innerHTML = `${circlesSVG}`; } -<<<<<<< HEAD -||||||| parent of 1dbb861 (Improve Benchmark constructor and instance variables (#255)) - - tearDown() { - if (isInBrowser) { - browserFileLoader.free(this.files); - browserFileLoader.free(this.preloadFiles); - } - } -======= - - tearDown() { - if (isInBrowser) { - browserFileLoader.free(this.files); - const preloadFiles = this.preloadEntries.map(([_, file]) => file); - browserFileLoader.free(preloadFiles); - } - } ->>>>>>> 1dbb861 (Improve Benchmark constructor and instance variables (#255)) }; class GroupedBenchmark extends Benchmark { From 125605d6f6c4240762d16d0a0a34dc28a74fb3bb Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 19 Jan 2026 14:42:57 +0100 Subject: [PATCH 3/5] fix-preloadEntries --- JetStreamDriver.js | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 62b1fa26..dfbaff7a 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -1089,7 +1089,7 @@ class Benchmark { scripts.add(text); } else { const cache = browserFileLoader.blobDataCache; - for (const file of this.plan.files) { + for (const file of this.files) { scripts.addWithURL(cache[file].blobURL); } } @@ -1150,7 +1150,7 @@ class Benchmark { prefetchResourcesForBrowser(counter) { console.assert(isInBrowser); - const promises = this.plan.files.map((file) => browserFileLoader.loadBlob("file", null, file).then((blobData) => { + const promises = this.files.map((file) => browserFileLoader.loadBlob("file", null, file).then((blobData) => { if (!globalThis.allIsGood) return; this.updateCounter(); @@ -1158,21 +1158,19 @@ class Benchmark { // We'll try again later in retryPrefetchResourceForBrowser(). Don't throw an error. })); - if (this.plan.preload) { - for (const [name, resource] of Object.entries(this.plan.preload)) { - promises.push(browserFileLoader.loadBlob("preload", name, resource).then((blobData) => { - if (!globalThis.allIsGood) - return; - this.preloads.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); - this.updateCounter(); - }).catch((error) => { - // We'll try again later in retryPrefetchResourceForBrowser(). Don't throw an error. - if (!this.failedPreloads) - this.failedPreloads = { }; - this.failedPreloads[name] = true; - counter.failedPreloadResources++; - })); - } + for (const [name, resource] of this.preloadEntries) { + promises.push(browserFileLoader.loadBlob("preload", name, resource).then((blobData) => { + if (!globalThis.allIsGood) + return; + this.preloads.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); + this.updateCounter(); + }).catch((error) => { + // We'll try again later in retryPrefetchResourceForBrowser(). Don't throw an error. + if (!this.failedPreloads) + this.failedPreloads = { }; + this.failedPreloads[name] = true; + counter.failedPreloadResources++; + })); } JetStream.counter.totalResources += promises.length; @@ -1183,19 +1181,17 @@ class Benchmark { // FIXME: Move to BrowserFileLoader. console.assert(isInBrowser); - for (const resource of this.plan.files) { + for (const resource of this.files) { const allDone = await browserFileLoader.retryPrefetchResource("file", null, resource); if (allDone) return true; // All resources loaded, nothing more to do. } - if (this.plan.preload) { - for (const [name, resource] of Object.entries(this.plan.preload)) { - const allDone = await browserFileLoader.retryPrefetchResource("preload", name, resource); - if (allDone) - return true; // All resources loaded, nothing more to do. - } + for (const [name, resource] of this.preloadEntries) { + const allDone = await browserFileLoader.retryPrefetchResource("preload", name, resource); + if (allDone) + return true; // All resources loaded, nothing more to do. } return !counter.failedPreloadResources && counter.loadedResources == counter.totalResources; } From 86ce02ea3836ae75a29e22b108c32f809365ebea Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 19 Jan 2026 14:55:51 +0100 Subject: [PATCH 4/5] pre-format --- JetStreamDriver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index dfbaff7a..3f11f0c4 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -279,7 +279,7 @@ class BrowserFileLoader { if (type == "preload") { if (this.failedPreloads && this.failedPreloads[blobData.prop]) { this.failedPreloads[blobData.prop] = false; - this.preloads.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); + this._preloadBlobData.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); counter.failedPreloadResources--; } } @@ -292,7 +292,7 @@ class BrowserFileLoader { if (!globalThis.allIsGood) return; if (blobData.type == "preload") - this.preloads.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); + this._preloadBlobData.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); this.updateCounter(); }); @@ -1162,7 +1162,7 @@ class Benchmark { promises.push(browserFileLoader.loadBlob("preload", name, resource).then((blobData) => { if (!globalThis.allIsGood) return; - this.preloads.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); + this._preloadBlobData.push({ name: blobData.prop, resource: blobData.resource, blobURLOrPath: blobData.blobURL }); this.updateCounter(); }).catch((error) => { // We'll try again later in retryPrefetchResourceForBrowser(). Don't throw an error. From 61bff365fba16923c09a1d9be8584c7914301575 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 19 Jan 2026 16:32:04 +0100 Subject: [PATCH 5/5] fix --- JetStreamDriver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 3f11f0c4..6a510822 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -909,7 +909,7 @@ class Benchmark { _processWorstCaseCount(worstCaseCount) { if (this.name in JetStreamParams.testWorstCaseCountMap) - return JetStreamParams.testWorstCaseCountMap[plan.name]; + return JetStreamParams.testWorstCaseCountMap[this.name]; if (JetStreamParams.testWorstCaseCount) return JetStreamParams.testWorstCaseCount; if (worstCaseCount !== undefined)