https://bugs.webkit.org/show_bug.cgi?id=122257
Reviewed by Oliver Hunt.
Individual test names with times was a good painting strategy years
back, when each benchmark took hundreds of milliseconds to run. Now,
the whole suite can finish in a a few hundres milliseconds, and things
look pretty flashy.
Instead, display a countdown that indicates which iteration of the
test we're on.
* resources/TEMPLATE.html: Work around a bug in Firefox by specifying
our style inside the .html file instead of in an external stylesheet.
Under heavy JavaScript load, Firefox neglects to apply external
stylesheets -- probably due to a starved timer.
* resources/driver-TEMPLATE.html: Delay a little between runs to ensure
that our countdown has enough time to paint.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156820
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-10-02 Geoffrey Garen <ggaren@apple.com>
+
+ Improved painting behavior in SunSpider 1.0.2
+ https://bugs.webkit.org/show_bug.cgi?id=122257
+
+ Reviewed by Oliver Hunt.
+
+ Individual test names with times was a good painting strategy years
+ back, when each benchmark took hundreds of milliseconds to run. Now,
+ the whole suite can finish in a a few hundres milliseconds, and things
+ look pretty flashy.
+
+ Instead, display a countdown that indicates which iteration of the
+ test we're on.
+
+ * resources/TEMPLATE.html: Work around a bug in Firefox by specifying
+ our style inside the .html file instead of in an external stylesheet.
+ Under heavy JavaScript load, Firefox neglects to apply external
+ stylesheets -- probably due to a starved timer.
+
+ * resources/driver-TEMPLATE.html: Delay a little between runs to ensure
+ that our countdown has enough time to paint.
+
2013-09-26 Geoffrey Garen <ggaren@apple.com>
Fixed a version number string in SunSpider 1.0.2
<title>SunSpider @NAME@</title>
<link rel="stylesheet" href="../sunspider.css">
+<style>
+#countdown {
+ font-size: 128px;
+ text-align: center;
+}
+</style>
</head>
<body>
-<h3>@NAME@</h3>
-<div id="console">
-</div>
+<h3 id="countdown"></h3>
<script>
+if (window.parent) {
+ document.getElementById("countdown").innerHTML =
+ window.parent.currentRepeat < 0
+ ? "warmup"
+ : (window.parent.repeatCount - window.parent.currentRepeat);
+}
+
function record(time) {
- document.getElementById("console").innerHTML = time + "ms";
- if (window.parent) {
+ if (window.parent)
parent.recordResult(time);
- }
}
window.onerror = function(e) {
function start()
{
- window.setTimeout(next, 500);
+ window.setTimeout(next, 128);
}
function next()
{
- var timeout = window.setTimeout(next, 0);
-
document.getElementById("frameparent").innerHTML = "";
document.getElementById("frameparent").innerHTML = "<iframe id='testframe'>";
var testFrame = document.getElementById("testframe");
- testIndex++;
- if (testIndex < tests.length) {
+ if (++testIndex < tests.length) {
+ window.setTimeout(next, 0);
+
testFrame.contentDocument.open();
testFrame.contentDocument.write(testContents[testIndex]);
testFrame.contentDocument.close();
} else if (++currentRepeat < repeatCount) {
- testIndex = 0;
- testFrame.contentDocument.open();
- testFrame.contentDocument.write(testContents[testIndex]);
- testFrame.contentDocument.close();
+ window.setTimeout(next, 128);
+
+ testIndex = -1;
} else {
- window.clearTimeout(timeout);
finish();
}
}