Changes between Version 8 and Version 9 of Performance Tests


Ignore:
Timestamp:
Aug 5, 2014 8:56:52 AM (8 years ago)
Author:
clopez@igalia.com
Comment:

Rename PerfTestRunner.runPerSecond to PerfTestRunner.measureRunsPerSecond https://trac.webkit.org/r131651

Legend:

Unmodified
Added
Removed
Modified
  • Performance Tests

    v8 v9  
    7070= Writing a Performance Test Using runner.js =
    7171
    72 The easiest way to write a performance test is using [http://trac.webkit.org/browser/trunk/PerformanceTests/resources/runner.js runner.js], which provides {{{PerfTestRunner}}} with various utility functions. Again, the easiest way to use this class is to call {{{PerfTestRunner.runPerSecond}}} with a test function. For example, see [http://trac.webkit.org/browser/trunk/PerformanceTests/Parser/tiny-innerHTML.html Parser/tiny-innerHTML.html]:
     72The easiest way to write a performance test is using [http://trac.webkit.org/browser/trunk/PerformanceTests/resources/runner.js runner.js], which provides {{{PerfTestRunner}}} with various utility functions. Again, the easiest way to use this class is to call {{{PerfTestRunner.measureRunsPerSecond}}} with a test function. For example, see [http://trac.webkit.org/browser/trunk/PerformanceTests/Parser/tiny-innerHTML.html Parser/tiny-innerHTML.html]:
    7373
    7474{{{
     
    7777<script src="../resources/runner.js"></script>
    7878<script>
    79 PerfTestRunner.runPerSecond({run:function() {
     79PerfTestRunner.measureRunsPerSecond({run:function() {
    8080    var testDiv = document.createElement("div");
    8181    testDiv.style.display = "none";
     
    9090}}}
    9191
    92 {{{PerfTestRunner.runPerSecond}}} measures the time of times {{{run}}} function could be called in one second, and reports the statistics after repeating it 20 times. The statistics includes arithmetic mean, standard deviation, median, minimum, and maximum values.  You can optionally specify the number of iterations (defaults to 2) and the test description as follows:
     92{{{PerfTestRunner.measureRunsPerSecond}}} measures the time of times {{{run}}} function could be called in one second, and reports the statistics after repeating it 20 times. The statistics includes arithmetic mean, standard deviation, median, minimum, and maximum values.  You can optionally specify the number of iterations (defaults to 2) and the test description as follows:
    9393{{{
    94 PerfTestRunner.runPerSecond({
     94PerfTestRunner.measureRunsPerSecond({
    9595    runCount: 50,
    9696    description: "Test with lots of iterations",
     
    9999}}}
    100100
    101 There is also {{{PerfTestRunner.run}}}, which measures the run time of a function. The use of this method is '''discouraged''' because the time gets smaller relative to the granularity of time measurement we can make as the WebKit's performance (or of the machines that run performance tests) improves. Nonetheless, it has been used in some animation tests where we cannot dynamically adjust the number of function calls as done in {{{runPerSecond}}}.
     101There is also {{{PerfTestRunner.run}}}, which measures the run time of a function. The use of this method is '''discouraged''' because the time gets smaller relative to the granularity of time measurement we can make as the WebKit's performance (or of the machines that run performance tests) improves. Nonetheless, it has been used in some animation tests where we cannot dynamically adjust the number of function calls as done in {{{measureRunsPerSecond}}}.
    102102
    103103{{{run}}} calls the specified function 10 times in each iteration and runs 20 iterations by default.  You can optionally specify how many times the function is called in each iteration and how many iterations are executed. You can also specify a function to be called after all iterations.