Commit 91858ce1 authored by eric@webkit.org's avatar eric@webkit.org

Add loopsPerRun option to Parser performance test runner

https://bugs.webkit.org/show_bug.cgi?id=69363

Reviewed by Antti Koivisto.

Add loopsPerRun option and abstract out runLoop function (to make the UI more responsive).
No change in behavior in any of the tests.

* Parser/resources/runner.js:
(runLoop):
(run):
(start):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6cb18a47
2011-10-04 Eric Seidel <eric@webkit.org>
Add loopsPerRun option to Parser performance test runner
https://bugs.webkit.org/show_bug.cgi?id=69363
Reviewed by Antti Koivisto.
Add loopsPerRun option and abstract out runLoop function (to make the UI more responsive).
No change in behavior in any of the tests.
* Parser/resources/runner.js:
(runLoop):
(run):
(start):
2011-10-03 Eric Seidel <eric@webkit.org>
Add a microbenchmark for a full-page render of the HTML5 spec
......
......@@ -67,29 +67,35 @@ function logStatistics(times) {
log("max " + computeMax(times));
}
function runLoop()
{
if (window.completedRuns < window.runCount) {
window.setTimeout(run, 0);
} else {
logStatistics(times);
}
}
function run() {
var start = new Date();
for (var i = 0; i < 10; ++i)
for (var i = 0; i < window.loopsPerRun; ++i)
window.runFunction();
var time = new Date() - start;
completedRuns++;
if (completedRuns <= 0) {
window.completedRuns++;
if (window.completedRuns <= 0) {
log("Ignoring warm-up run (" + time + ")");
} else {
times.push(time);
log(time);
}
if (completedRuns < window.runCount) {
window.setTimeout(run, 0);
} else {
logStatistics(times);
}
runLoop()
}
function start(runCount, runFunction) {
function start(runCount, runFunction, loopsPerRun) {
window.runCount = runCount;
window.runFunction = runFunction;
window.loopsPerRun = loopsPerRun || 10;
log("Running " + runCount + " times");
run();
runLoop();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment