Skip to content

Commit 3bfe58c

Browse files
authored
Use subScores directly for the UI (#81)
This is a first step to work towards just relying on the subscores() data to populate the UI - Use subScores object to prepare the UI - delete scoreDescription() since its no longer needed
1 parent 9ded22d commit 3bfe58c

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

JetStreamDriver.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,11 @@ class Driver {
394394
let text = "";
395395
let newBenchmarks = [];
396396
for (const benchmark of this.benchmarks) {
397-
const id = JSON.stringify(benchmark.constructor.scoreDescription());
398-
const description = JSON.parse(id);
397+
const description = Object.keys(benchmark.subScores());
398+
description.push("Score");
399399

400400
newBenchmarks.push(benchmark);
401-
const scoreIds = benchmark.scoreIdentifiers()
401+
const scoreIds = benchmark.scoreIdentifiers();
402402
const overallScoreId = scoreIds.pop();
403403

404404
if (isInBrowser) {
@@ -1005,7 +1005,6 @@ class Benchmark {
10051005
return this._resourcesPromise;
10061006
}
10071007

1008-
static scoreDescription() { throw new Error("Must be implemented by subclasses."); }
10091008
scoreIdentifiers() { throw new Error("Must be implemented by subclasses"); }
10101009

10111010
updateUIBeforeRun() {
@@ -1088,10 +1087,6 @@ class DefaultBenchmark extends Benchmark {
10881087
};
10891088
}
10901089

1091-
static scoreDescription() {
1092-
return ["First", "Worst", "Average", "Score"];
1093-
}
1094-
10951090
scoreIdentifiers() {
10961091
return [firstID(this), worst4ID(this), avgID(this), scoreID(this)];
10971092
}
@@ -1310,10 +1305,6 @@ class WSLBenchmark extends Benchmark {
13101305
};
13111306
}
13121307

1313-
static scoreDescription() {
1314-
return ["Stdlib", "MainRun", "Score"];
1315-
}
1316-
13171308
scoreIdentifiers() {
13181309
return ["wsl-stdlib-score", "wsl-tests-score", "wsl-score-score"];
13191310
}
@@ -1486,10 +1477,6 @@ class WasmLegacyBenchmark extends Benchmark {
14861477
};
14871478
}
14881479

1489-
static scoreDescription() {
1490-
return ["Startup", "Runtime", "Score"];
1491-
}
1492-
14931480
get startupID() {
14941481
return `wasm-startup-id${this.name}`;
14951482
}

0 commit comments

Comments
 (0)