Changeset 65940 in webkit


Ignore:
Timestamp:
Aug 24, 2010 3:22:14 PM (14 years ago)
Author:
ojan@chromium.org
Message:

2010-08-24 Ojan Vafai <ojan@chromium.org>

Reviewed by Tony Chang.

perf tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=44199

Speculative fix for perf test flakiness. Use chromium.Interval
to get a microsecond granularity timer. If this does end up
reducing flakiness, then we can expose something similar for
JSC and/or layoutTestController.

  • resources/magnitude-perf.js: (Magnitude._runIteration): (Magnitude):
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r65939 r65940  
     12010-08-24  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        perf tests are flaky
     6        https://bugs.webkit.org/show_bug.cgi?id=44199
     7
     8        Speculative fix for perf test flakiness. Use chromium.Interval
     9        to get a microsecond granularity timer. If this does end up
     10        reducing flakiness, then we can expose something similar for
     11        JSC and/or layoutTestController.
     12
     13        * resources/magnitude-perf.js:
     14        (Magnitude._runIteration):
     15        (Magnitude):
     16
    1172010-08-24  Pavel Podivilov  <podivilov@chromium.org>
    218
  • trunk/LayoutTests/resources/magnitude-perf.js

    r65614 r65940  
    204204    setup(magnitude);
    205205
    206     var start = Date.now();
    207206    var iterations = 0;
    208     while (Date.now() - start < milliseconds) {
    209         // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
    210         for (var i = 0; i < runsPerIteration; i++) {
    211             test(magnitude);
    212         }
    213         iterations++;
     207    if (window.chromium) {
     208      // FIXME: If using microseconds turns out to be less flaky, expose microseconds
     209      // from JSC or layoutTestController and use them. Otherwise, get rid of this block.
     210      var microseconds = milliseconds * 1000;
     211      var interval = new chromium.Interval();
     212      interval.start();
     213      while (interval.microseconds() < microseconds) {
     214          // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
     215          for (var i = 0; i < runsPerIteration; i++) {
     216              test(magnitude);
     217          }
     218          iterations++;
     219      }
     220      interval.stop();
     221    } else {
     222      var start = Date.now();
     223      while (Date.now() - start < milliseconds) {
     224          // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
     225          for (var i = 0; i < runsPerIteration; i++) {
     226              test(magnitude);
     227          }
     228          iterations++;
     229      }
    214230    }
    215231    return iterations;
Note: See TracChangeset for help on using the changeset viewer.