From f113d429c867c6bc46e1e375c0288607a5e3a3f9 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 22 Sep 2025 10:18:04 +0200 Subject: [PATCH 1/4] fix --- cli.js | 3 ++- params.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cli.js b/cli.js index 6c0ccb63..7794358f 100644 --- a/cli.js +++ b/cli.js @@ -121,7 +121,8 @@ load("./params.js"); async function runJetStream() { if (!JetStreamParams.isDefault) { - console.warn(`Using non standard params: ${JSON.stringify(JetStreamParams, null, 2)}`) + const paramsDiff = JetStreamParams.nonDefaultParams; + console.warn(`Using non standard params: ${JSON.stringify(paramsDiff, null, 2)}`) } try { await JetStream.initialize(); diff --git a/params.js b/params.js index 37c22a66..cc640da1 100644 --- a/params.js +++ b/params.js @@ -132,6 +132,17 @@ class Params { get isDefault() { return this === DefaultJetStreamParams; } + + get nonDefaultParams() { + const diff = Object.create(null); + console.log(Object.entries(this)) + for (const [key, value] in Object.entries(this)) { + if (value != DefaultJetStreamParams[key]) { + diff[key] = value; + } + } + return diff; + } } const DefaultJetStreamParams = new Params(); From dc29a4f0a01b4cdb06afa4d22402f54270a79fed Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Tue, 23 Sep 2025 12:59:18 +0200 Subject: [PATCH 2/4] better output --- JetStreamDriver.js | 8 ++++---- params.js | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 8b74ab20..7df0111f 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -59,8 +59,8 @@ function displayCategoryScores() { } function getIterationCount(plan) { - if (JetStreamParams.testIterationCountMap.has(plan.name)) - return JetStreamParams.testIterationCountMap.get(plan.name); + if (plan.name in JetStreamParams.testIterationCountMap) + return JetStreamParams.testIterationCountMap[plan.name]; if (JetStreamParams.testIterationCount) return JetStreamParams.testIterationCount; if (plan.iterations) @@ -69,8 +69,8 @@ function getIterationCount(plan) { } function getWorstCaseCount(plan) { - if (JetStreamParams.testWorstCaseCountMap.has(plan.name)) - return JetStreamParams.testWorstCaseCountMap.get(plan.name); + if (plan.name in JetStreamParams.testWorstCaseCountMap) + return JetStreamParams.testWorstCaseCountMap[plan.name]; if (JetStreamParams.testWorstCaseCount) return JetStreamParams.testWorstCaseCount; if (plan.worstCaseCount !== undefined) diff --git a/params.js b/params.js index cc640da1..6c0da8da 100644 --- a/params.js +++ b/params.js @@ -25,6 +25,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +const defaultEmptyMap = Object.freeze({}); class Params { // Enable a detailed developer menu to change the current Params. @@ -40,8 +41,11 @@ class Params { RAMification = false; dumpJSONResults = false; - testIterationCountMap = new Map(); - testWorstCaseCountMap = new Map(); + // Override iteration and worst-case counts per workload. + // Example: + // testIterationCountMap = { "acorn-wtb": 5 }; + testIterationCountMap = defaultEmptyMap; + testWorstCaseCountMap = defaultEmptyMap; customPreIterationCode = undefined; customPostIterationCode = undefined; @@ -135,8 +139,7 @@ class Params { get nonDefaultParams() { const diff = Object.create(null); - console.log(Object.entries(this)) - for (const [key, value] in Object.entries(this)) { + for (const [key, value] of Object.entries(this)) { if (value != DefaultJetStreamParams[key]) { diff[key] = value; } From 74e0a9467e63853d07a9f9a0dd7eec233562fd00 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Wed, 1 Oct 2025 21:34:10 +0200 Subject: [PATCH 3/4] fix --- params.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params.js b/params.js index b507678f..c60d9191 100644 --- a/params.js +++ b/params.js @@ -61,7 +61,7 @@ class Params { _copyFromSearchParams(sourceParams) { this.startAutomatically = this._parseBooleanParam(sourceParams, "startAutomatically"); this.developerMode = this._parseBooleanParam(sourceParams, "developerMode"); - this.shouldReport = this._parseBooleanParam(sourceParams, "report"); + this.shouldReport = this._parseBooleanParam(sourceParams, "shouldReport"); this.prefetchResources = this._parseBooleanParam(sourceParams, "prefetchResources"); this.RAMification = this._parseBooleanParam(sourceParams, "RAMification"); this.dumpJSONResults = this._parseBooleanParam(sourceParams, "dumpJSONResults"); From 1346a07b32371fc2e85af2c7e9f376b726479945 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Wed, 1 Oct 2025 22:52:44 +0200 Subject: [PATCH 4/4] use-strict-equal --- params.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params.js b/params.js index c60d9191..1789c5e5 100644 --- a/params.js +++ b/params.js @@ -142,7 +142,7 @@ class Params { get nonDefaultParams() { const diff = Object.create(null); for (const [key, value] of Object.entries(this)) { - if (value != DefaultJetStreamParams[key]) { + if (value !== DefaultJetStreamParams[key]) { diff[key] = value; } }