Skip to content

Commit fe1f348

Browse files
authored
Add more performance.measure (#110)
- Annotate update-ui - Annotate complete workload time span
1 parent 3f5a114 commit fe1f348

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

JetStreamDriver.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,12 @@ class Driver {
231231
} else if (!dumpJSONResults)
232232
console.log("Starting JetStream3");
233233

234-
await updateUI();
235-
234+
performance.mark("update-ui-start");
236235
const start = performance.now();
237236
for (const benchmark of this.benchmarks) {
238-
benchmark.updateUIBeforeRun();
239-
237+
await benchmark.updateUIBeforeRun();
240238
await updateUI();
239+
performance.measure("runner update-ui", "update-ui-start");
241240

242241
try {
243242
await benchmark.run();
@@ -246,6 +245,7 @@ class Driver {
246245
throw e;
247246
}
248247

248+
performance.mark("update-ui");
249249
benchmark.updateUIAfterRun();
250250

251251
if (isInBrowser) {
@@ -258,6 +258,7 @@ class Driver {
258258
}
259259
}
260260
}
261+
performance.measure("runner update-ui", "update-ui-start");
261262

262263
const totalTime = performance.now() - start;
263264
if (measureTotalTimeAsSubtest) {
@@ -774,6 +775,7 @@ class Benchmark {
774775
}
775776
addScript(this.runnerCode);
776777

778+
performance.mark(this.name);
777779
this.startTime = performance.now();
778780

779781
if (RAMification)
@@ -794,6 +796,7 @@ class Benchmark {
794796
const results = await promise;
795797

796798
this.endTime = performance.now();
799+
performance.measure(this.name, this.name);
797800

798801
if (RAMification) {
799802
const memoryFootprint = MemoryFootprint();

shell-config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ if (isSpiderMonkey) {
3737
globalThis.readFile = readRelativeToScript;
3838
globalThis.arguments = scriptArgs;
3939
}
40+
41+
if (typeof performance == "undefined")
42+
performance = {};
43+
44+
performance.mark ??= function(){};
45+
performance.measure ??= function(){};

0 commit comments

Comments
 (0)