[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf

mjs at apple.com mjs at apple.com
Tue Jan 5 23:49:37 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 7b2db63623466b8f78ccd054fce8ba9efedf6e36
Author: mjs at apple.com <mjs at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 15 03:27:19 2009 +0000

    2009-12-14  Maciej Stachowiak  <mjs at apple.com>
    
            Reviewed by Sam Weinig.
    
            in-browser SunSpider suffers excessive penalty under power management
            https://bugs.webkit.org/show_bug.cgi?id=32505
    
            I have made a few changes to address this:
    
            1) Change how browser-hosted SunSpider loads tests - preload the content and write it in with
            document.write to reduce triggering of progress UI.
            2) Reduce time between tests to 10ms from 500ms, so that power management doesn't keep the CPU
            stepped all the way down the whole time.
            3) Run the test cycle an extra time for warmup before the runs that count.
    
            * hosted/sunspider-record-result.js: Removed.
            * make-hosted:
            * resources/TEMPLATE.html:
            * resources/driver-TEMPLATE.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/SunSpider/ChangeLog b/SunSpider/ChangeLog
index f96ef41..b5b32e0 100644
--- a/SunSpider/ChangeLog
+++ b/SunSpider/ChangeLog
@@ -1,3 +1,23 @@
+2009-12-14  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        in-browser SunSpider suffers excessive penalty under power management
+        https://bugs.webkit.org/show_bug.cgi?id=32505
+        
+        I have made a few changes to address this:
+        
+        1) Change how browser-hosted SunSpider loads tests - preload the content and write it in with
+        document.write to reduce triggering of progress UI.
+        2) Reduce time between tests to 10ms from 500ms, so that power management doesn't keep the CPU
+        stepped all the way down the whole time.
+        3) Run the test cycle an extra time for warmup before the runs that count.
+
+        * hosted/sunspider-record-result.js: Removed.
+        * make-hosted:
+        * resources/TEMPLATE.html:
+        * resources/driver-TEMPLATE.html:
+
 2009-12-13  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Gavin Barraclough.
diff --git a/SunSpider/hosted/sunspider-record-result.js b/SunSpider/hosted/sunspider-record-result.js
deleted file mode 100644
index f86749a..0000000
--- a/SunSpider/hosted/sunspider-record-result.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-function record(time) {
-    document.getElementById("console").innerHTML = time + "ms";
-    if (window.parent) {
-        parent.recordResult(time);
-    }
-}
diff --git a/SunSpider/make-hosted b/SunSpider/make-hosted
index e4531a4..fb4608a 100755
--- a/SunSpider/make-hosted
+++ b/SunSpider/make-hosted
@@ -61,6 +61,7 @@ foreach my $suite (@suites) {
     }
     close TESTLIST;
 
+    my @testContents = ();
     for my $test (@tests) {
 	my $name = "${test}";
 
@@ -71,10 +72,11 @@ foreach my $suite (@suites) {
 	my $output = $template;
 	$output =~ s/\@NAME\@/${name}/g;
 	$output =~ s/\@SCRIPT\@/${script}/g;
-
-	open OUTPUT, ">hosted/${suite}/${test}.html";
-	print OUTPUT $output;
-	close OUTPUT;
+	$output =~ s/\\/\\\\/g;
+	$output =~ s/"/\\"/g;
+	$output =~ s/\n/\\n\\\n/g;
+	$output = $output;
+	push @testContents, $output;
     }
 
     my $output = $driverTemplate;
@@ -91,7 +93,6 @@ foreach my $suite (@suites) {
     print OUTPUT $output;
     close OUTPUT;
 
-
     my $prefix = "var tests = [ " . join(", ", map { '"' . $_ . '"' } @tests) . " ];\n";
     $prefix .= "var categories = [ " . join(", ", map { '"' . $_ . '"' } @categories) . " ];\n";
 
@@ -99,7 +100,11 @@ foreach my $suite (@suites) {
     print PREFIX $prefix;
     close PREFIX;
 
-    
+    my $contents = "var testContents = [ " . join(", ", map { '"' . $_ . '"' } @testContents) . " ];\n";
+
+    open CONTENTS, ">hosted/${suite}/sunspider-test-contents.js";
+    print CONTENTS $contents;
+    close CONTENTS;    
 }
 
 system("cp resources/sunspider-analyze-results.js hosted");
diff --git a/SunSpider/resources/TEMPLATE.html b/SunSpider/resources/TEMPLATE.html
index 7259e0f..ae30db6 100644
--- a/SunSpider/resources/TEMPLATE.html
+++ b/SunSpider/resources/TEMPLATE.html
@@ -33,8 +33,13 @@
 <h3>@NAME@</h3>
 <div id="console">
 </div>
-<script src="../sunspider-record-result.js"></script>
 <script>
+function record(time) {
+    document.getElementById("console").innerHTML = time + "ms";
+    if (window.parent) {
+        parent.recordResult(time);
+    }
+}
 
 var _sunSpiderStartDate = new Date();
 
diff --git a/SunSpider/resources/driver-TEMPLATE.html b/SunSpider/resources/driver-TEMPLATE.html
index c6a6f1e..92ef0fb 100644
--- a/SunSpider/resources/driver-TEMPLATE.html
+++ b/SunSpider/resources/driver-TEMPLATE.html
@@ -30,16 +30,17 @@
 <link rel="stylesheet" href="../sunspider.css">
 </head>
 
-<body onload="next()">
+<body onload="start()">
 
 <h2><span id="logo">&#x2600;</span>SunSpider JavaScript Benchmark <small>(In Progress...)</small></h2>
 <h4>Version: @SUITE@</h4>
 
 <script src="sunspider-test-prefix.js"></script>
+<script src="sunspider-test-contents.js"></script>
 <script>
 var testIndex = -1;
-var currentRepeat = 0;
-var repeatCount = 5;
+var currentRepeat = -1;
+var repeatCount = 10;
 
 var output = [];
 output.length = repeatCount;
@@ -47,19 +48,31 @@ for (var i = 0; i < output.length; i++) {
     output[i] = {};
 }
 
-function next() 
+function start() 
 {
     window.setTimeout(reallyNext, 500);
 }
 
+function next() 
+{
+    window.setTimeout(reallyNext, 10);
+}
+
 function reallyNext() 
 {
+    document.getElementById("frameparent").innerHTML = "";
+    document.getElementById("frameparent").innerHTML = "<iframe id='testframe'>";
+    var testFrame = document.getElementById("testframe");
     testIndex++;
     if (testIndex < tests.length) {
-        document.getElementById("testframe").src = tests[testIndex] + ".html";
+        testFrame.contentDocument.open();
+        testFrame.contentDocument.write(testContents[testIndex]);
+        testFrame.contentDocument.close;
     } else if (++currentRepeat < repeatCount) { 
         testIndex = 0;
-        document.getElementById("testframe").src = tests[testIndex] + ".html";
+        testFrame.contentDocument.open();
+        testFrame.contentDocument.write(testContents[testIndex]);
+        testFrame.contentDocument.close;
     } else {
         finish();
     }
@@ -67,7 +80,8 @@ function reallyNext()
 
 function recordResult(time)
 {
-    output[currentRepeat][tests[testIndex]] = time;
+    if (currentRepeat >= 0) // negative repeats are warmups
+        output[currentRepeat][tests[testIndex]] = time;
     next();
 }
 
@@ -90,8 +104,8 @@ function finish()
 
 </script>
 
-<iframe id="testframe">
-</iframe>
+<div id="frameparent">
+</div>
 
 </body>
 </html>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list