Modified: trunk/PerformanceTests/JetStream2/JetStreamDriver.js (251264 => 251265)
--- trunk/PerformanceTests/JetStream2/JetStreamDriver.js 2019-10-17 22:45:35 UTC (rev 251264)
+++ trunk/PerformanceTests/JetStream2/JetStreamDriver.js 2019-10-17 22:53:44 UTC (rev 251265)
@@ -34,6 +34,15 @@
if (typeof testIterationCount === "undefined")
var testIterationCount = undefined;
+if (typeof testIterationCountMap === "undefined")
+ var testIterationCountMap = new Map;
+
+if (typeof testWorstCaseCountMap === "undefined")
+ var testWorstCaseCountMap = new Map;
+
+if (typeof dumpJSONResults === "undefined")
+ var dumpJSONResults = false;
+
// Used for the promise representing the current benchmark run.
this.currentResolve = null;
this.currentReject = null;
@@ -55,6 +64,24 @@
categoryScores = null;
}
+function getIterationCount(plan) {
+ if (testIterationCountMap.has(plan.name))
+ return testIterationCountMap.get(plan.name);
+ if (testIterationCount)
+ return testIterationCount;
+ if (plan.iterations)
+ return plan.iterations;
+ return defaultIterationCount;
+}
+
+function getWorstCaseCount(plan) {
+ if (testWorstCaseCountMap.has(plan.name))
+ return testWorstCaseCountMap.get(plan.name);
+ if (plan.worstCaseCount)
+ return plan.worstCaseCount;
+ return defaultWorstCaseCount;
+}
+
if (isInBrowser) {
document._onkeydown_ = (keyboardEvent) => {
let key = keyboardEvent.key;
@@ -250,6 +277,7 @@
}
this.reportScoreToRunBenchmarkRunner();
+ this.dumpJSONResultsIfNeeded();
}
runCode(string)
@@ -355,14 +383,8 @@
}
}
- async reportScoreToRunBenchmarkRunner()
+ resultsJSON()
{
- if (!isInBrowser)
- return;
-
- if (window.location.search !== '?report=true')
- return;
-
let results = {};
for (let benchmark of this.benchmarks) {
const subResults = {}
@@ -381,7 +403,27 @@
results = {"JetStream2.0": {"metrics" : {"Score" : ["Geometric"]}, "tests" : results}};
- const content = JSON.stringify(results);
+ return JSON.stringify(results);
+ }
+
+ dumpJSONResultsIfNeeded()
+ {
+ if (dumpJSONResults) {
+ print("\n");
+ print(this.resultsJSON());
+ print("\n");
+ }
+ }
+
+ async reportScoreToRunBenchmarkRunner()
+ {
+ if (!isInBrowser)
+ return;
+
+ if (window.location.search !== '?report=true')
+ return;
+
+ const content = this.resultsJSON();
await fetch("/report", {
method: "POST",
heeaders: {
@@ -398,7 +440,7 @@
constructor(plan)
{
this.plan = plan;
- this.iterations = testIterationCount || plan.iterations || defaultIterationCount;
+ this.iterations = getIterationCount(plan);
this.isAsync = !!plan.isAsync;
this.scripts = null;
@@ -623,7 +665,7 @@
constructor(...args) {
super(...args);
- this.worstCaseCount = this.plan.worstCaseCount || defaultWorstCaseCount;
+ this.worstCaseCount = getWorstCaseCount(this.plan);
this.firstIteration = null;
this.worst4 = null;
this.average = null;
Added: trunk/PerformanceTests/JetStream2/watch-cli.js (0 => 251265)
--- trunk/PerformanceTests/JetStream2/watch-cli.js (rev 0)
+++ trunk/PerformanceTests/JetStream2/watch-cli.js 2019-10-17 22:53:44 UTC (rev 251265)
@@ -0,0 +1,65 @@
+dumpJSONResults = true;
+
+testIterationCount = 15;
+
+testList = [
+ {name: "FlightPlanner"},
+ {name: "UniPoker"},
+ {name: "Air"},
+ {name: "Basic"},
+ {name: "ML", iterations: 7, worstCaseCount: 2},
+ {name: "Babylon"},
+ {name: "cdjs", iterations: 10, worstCaseCount: 2},
+ {name: "first-inspector-code-load"},
+ {name: "multi-inspector-code-load"},
+ {name: "Box2D"},
+ {name: "octane-code-load"},
+ {name: "crypto"},
+ {name: "delta-blue"},
+ {name: "earley-boyer"},
+ {name: "gbemu", iterations: 10, worstCaseCount: 2},
+ {name: "navier-stokes"},
+ {name: "pdfjs"},
+ {name: "raytrace"},
+ {name: "regexp"},
+ {name: "richards"},
+ {name: "splay"},
+ {name: "ai-astar"},
+ {name: "gaussian-blur", iterations: 10, worstCaseCount: 2},
+ {name: "stanford-crypto-aes"},
+ {name: "stanford-crypto-pbkdf2"},
+ {name: "stanford-crypto-sha256"},
+ {name: "json-stringify-inspector"},
+ {name: "json-parse-inspector"},
+ {name: "async-fs", iterations: 8, worstCaseCount: 2},
+ {name: "hash-map", iterations: 12, worstCaseCount: 3},
+ {name: "3d-cube-SP"},
+ {name: "3d-raytrace-SP"},
+ {name: "base64-SP"},
+ {name: "crypto-aes-SP"},
+ {name: "crypto-md5-SP"},
+ {name: "crypto-sha1-SP"},
+ {name: "date-format-tofte-SP"},
+ {name: "date-format-xparb-SP"},
+ {name: "n-body-SP"},
+ {name: "regex-dna-SP"},
+ {name: "string-unpack-code-SP"},
+ {name: "tagcloud-SP"},
+ {name: "chai-wtb", iterations: 5, worstCaseCount: 2},
+ {name: "jshint-wtb", iterations: 5, worstCaseCount: 2},
+ {name: "prepack-wtb", iterations: 5, worstCaseCount: 2}
+];
+
+testIterationCountMap = new Map;
+testWorstCaseCountMap = new Map;
+for (let test of testList) {
+ if (test.iterations)
+ testIterationCountMap.set(test.name, test.iterations);
+ if (test.worstCaseCount)
+ testWorstCaseCountMap.set(test.name, test.worstCaseCount);
+}
+
+
+testList = testList.map(x => x.name);
+
+load("./cli.js");