From beb4a6dd9596cfd7860c414aefc0e26887c8f81a Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Thu, 31 Jul 2025 15:38:22 +0200 Subject: [PATCH 1/4] update UI performance.mark --- JetStreamDriver.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index de06496d..f7e7e791 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -159,7 +159,7 @@ function updateUI() { if (isInBrowser) requestAnimationFrame(() => setTimeout(resolve, 0)); else - resolve(); + return resolve(); }); } @@ -231,13 +231,12 @@ class Driver { } else if (!dumpJSONResults) console.log("Starting JetStream3"); - await updateUI(); - + performance.mark("update-ui-start"); const start = performance.now(); for (const benchmark of this.benchmarks) { - benchmark.updateUIBeforeRun(); - + await benchmark.updateUIBeforeRun(); await updateUI(); + performance.measure("runner update-ui", "update-ui-start"); try { await benchmark.run(); @@ -246,6 +245,7 @@ class Driver { throw e; } + performance.mark("update-ui"); benchmark.updateUIAfterRun(); if (isInBrowser) { @@ -258,6 +258,7 @@ class Driver { } } } + performance.measure("runner update-ui", "update-ui-start"); const totalTime = performance.now() - start; if (measureTotalTimeAsSubtest) { @@ -774,6 +775,7 @@ class Benchmark { } addScript(this.runnerCode); + performance.mark(this.name); this.startTime = performance.now(); if (RAMification) @@ -794,6 +796,7 @@ class Benchmark { const results = await promise; this.endTime = performance.now(); + performance.measure(this.name, this.name); if (RAMification) { const memoryFootprint = MemoryFootprint(); From 24e5575c0c18c63aceb291207d686928ba2d1a33 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Thu, 31 Jul 2025 15:38:58 +0200 Subject: [PATCH 2/4] cleanup --- JetStreamDriver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index f7e7e791..7c70bdcf 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -159,7 +159,7 @@ function updateUI() { if (isInBrowser) requestAnimationFrame(() => setTimeout(resolve, 0)); else - return resolve(); + resolve(); }); } From 8a4ae0b122bb37a15850c689c42734874e2066fc Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Thu, 31 Jul 2025 16:38:22 +0200 Subject: [PATCH 3/4] add missing performance methods --- shell-config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell-config.js b/shell-config.js index 405ddcd8..3ec8b48a 100644 --- a/shell-config.js +++ b/shell-config.js @@ -37,3 +37,6 @@ if (isSpiderMonkey) { globalThis.readFile = readRelativeToScript; globalThis.arguments = scriptArgs; } + +performance.mark ??= function(){}; +performance.measure ??= function(){}; \ No newline at end of file From 4d6e9e8fc999131ac4c3d17a44e252bc9db9527f Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Thu, 31 Jul 2025 16:43:23 +0200 Subject: [PATCH 4/4] shell config --- shell-config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell-config.js b/shell-config.js index 3ec8b48a..4c88186c 100644 --- a/shell-config.js +++ b/shell-config.js @@ -38,5 +38,8 @@ if (isSpiderMonkey) { globalThis.arguments = scriptArgs; } +if (typeof performance == "undefined") + performance = {}; + performance.mark ??= function(){}; performance.measure ??= function(){}; \ No newline at end of file