Changeset 129817 in webkit


Ignore:
Timestamp:
Sep 27, 2012 4:39:09 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

PerformanceTests/CSS/StyleSheetInsert.html has a time-dependent non-Gaussian distribution
https://bugs.webkit.org/show_bug.cgi?id=97741

Reviewed by Antti Koivisto.

Reset the content in the iframe in each run so that the runtime from each run follows a normal distribution.
We can cleanup this code once my patch to replace the argument list of run by an object is landed.

  • CSS/StyleSheetInsert.html:
Location:
trunk/PerformanceTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/CSS/StyleSheetInsert.html

    r129644 r129817  
    88</body>
    99<script>
    10 var frame = document.getElementsByTagName("iframe")[0];
    11 var testDoc = frame.contentDocument;
    12 var docText = "";
    13 docText += "<body><style>.foo {color:red}</style>";
    14 docText += "<div class='bar'>Foo</div>";
    15 for (var i = 0; i < 10000; ++i)
    16     docText += "<div class='foo'>Foo</div>";
    17 testDoc.body.innerHTML = docText;
     10
     11function setup() {
     12    var frame = document.getElementsByTagName("iframe")[0];
     13    var testDoc = frame.contentDocument;
     14    var docText = "";
     15    docText += "<body><style>.foo {color:red}</style>";
     16    docText += "<div class='bar'>Foo</div>";
     17    for (var i = 0; i < 10000; ++i)
     18        docText += "<div class='foo'>Foo</div>";
     19    testDoc.body.innerHTML = docText;
     20    return testDoc;
     21}
    1822
    1923PerfTestRunner.run(function() {
    20     var styleElem = testDoc.createElement("style");
    21     styleElem.innerText = ".bar {color:green}";
    22     testDoc.body.insertBefore(styleElem, testDoc.body.firstChild);
    23 }, 50, 10);
     24    var testDoc = setup();
     25    var start = PerfTestRunner.now();
     26    for (var i = 0; i < 50; i++) {
     27        var styleElem = testDoc.createElement("style");
     28        styleElem.innerText = ".bar {color:green}";
     29        testDoc.body.insertBefore(styleElem, testDoc.body.firstChild);
     30    }
     31    return PerfTestRunner.now() - start;
     32}, 1);
    2433</script>
    2534</html>
  • trunk/PerformanceTests/ChangeLog

    r129816 r129817  
     12012-09-27  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        PerformanceTests/CSS/StyleSheetInsert.html has a time-dependent non-Gaussian distribution
     4        https://bugs.webkit.org/show_bug.cgi?id=97741
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Reset the content in the iframe in each run so that the runtime from each run follows a normal distribution.
     9        We can cleanup this code once my patch to replace the argument list of run by an object is landed.
     10
     11        * CSS/StyleSheetInsert.html:
     12
    1132012-09-27  Ryosuke Niwa  <rniwa@webkit.org>
    214
Note: See TracChangeset for help on using the changeset viewer.