Changeset 96634 in webkit


Ignore:
Timestamp:
Oct 4, 2011 1:16:51 PM (13 years ago)
Author:
eric@webkit.org
Message:

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):

Location:
trunk/PerformanceTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r96559 r96634  
     12011-10-04  Eric Seidel  <eric@webkit.org>
     2
     3        Add loopsPerRun option to Parser performance test runner
     4        https://bugs.webkit.org/show_bug.cgi?id=69363
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Add loopsPerRun option and abstract out runLoop function (to make the UI more responsive).
     9        No change in behavior in any of the tests.
     10
     11        * Parser/resources/runner.js:
     12        (runLoop):
     13        (run):
     14        (start):
     15
    1162011-10-03  Eric Seidel  <eric@webkit.org>
    217
  • trunk/PerformanceTests/Parser/resources/runner.js

    r77436 r96634  
    6868}
    6969
    70 function run() {
    71     var start = new Date();
    72     for (var i = 0; i < 10; ++i)
    73         window.runFunction();
    74     var time = new Date() - start;
    75     completedRuns++;
    76     if (completedRuns <= 0) {
    77         log("Ignoring warm-up run (" + time + ")");
    78     } else {
    79         times.push(time);
    80         log(time);
    81     }
    82     if (completedRuns < window.runCount) {
     70function runLoop()
     71{
     72    if (window.completedRuns < window.runCount) {
    8373        window.setTimeout(run, 0);
    8474    } else {
     
    8777}
    8878
    89 function start(runCount, runFunction) {
     79function run() {
     80    var start = new Date();
     81    for (var i = 0; i < window.loopsPerRun; ++i)
     82        window.runFunction();
     83    var time = new Date() - start;
     84    window.completedRuns++;
     85    if (window.completedRuns <= 0) {
     86        log("Ignoring warm-up run (" + time + ")");
     87    } else {
     88        times.push(time);
     89        log(time);
     90    }
     91    runLoop()
     92}
     93
     94function start(runCount, runFunction, loopsPerRun) {
    9095    window.runCount = runCount;
    9196    window.runFunction = runFunction;
     97    window.loopsPerRun = loopsPerRun || 10;
    9298
    9399    log("Running " + runCount + " times");
    94     run();
     100    runLoop();
    95101}
Note: See TracChangeset for help on using the changeset viewer.