Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: test/js-perf-test/base.js

Issue 1133843007: Adjust benchmark framework to avoid spending 50% of time on 'new Date' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/js-perf-test/base.js
diff --git a/test/js-perf-test/base.js b/test/js-perf-test/base.js
index b0ce40b888b3a1388e63ade8ae38f4417fa76c04..cef2867f2b037b8ec79f3153cc8e9abdfe8fb14e 100644
--- a/test/js-perf-test/base.js
+++ b/test/js-perf-test/base.js
@@ -281,28 +281,28 @@ BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark, data) {
// by minIterations, depending on the config flag doDeterministic.
for (var i = 0; (doDeterministic ?
i<benchmark.deterministicIterations : elapsed < 1000); i++) {
- benchmark.run();
+ for (var j = 0; j < 100; j++) benchmark.run();
elapsed = new Date() - start;
}
if (data != null) {
- data.runs += i;
+ data.hectoruns += i;
data.elapsed += elapsed;
}
}
// Sets up data in order to skip or not the warmup phase.
if (!doWarmup && data == null) {
- data = { runs: 0, elapsed: 0 };
+ data = { hectoruns: 0, elapsed: 0 };
}
if (data == null) {
Measure(null);
- return { runs: 0, elapsed: 0 };
+ return { hectoruns: 0, elapsed: 0 };
} else {
Measure(data);
// If we've run too few iterations, we continue for another second.
- if (data.runs < benchmark.minIterations) return data;
- var usec = (data.elapsed * 1000) / data.runs;
+ if (data.hectoruns * 100 < benchmark.minIterations) return data;
+ var usec = (data.elapsed * 10) / data.hectoruns;
var rms = (benchmark.rmsResult != null) ? benchmark.rmsResult() : 0;
this.NotifyStep(new BenchmarkResult(benchmark, usec, rms));
return null;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698