+2014-06-01 Ryosuke Niwa <rniwa@webkit.org>
+
+ DYEBench: Split stylesheets and scripts in Full.html into separate files
+ https://bugs.webkit.org/show_bug.cgi?id=133437
+
+ Reviewed by Benjamin Poulain.
+
+ Extracted main.js and main.css.
+
+ Also fixed a bug in startBenchmark that disabled suites were counted towards the total number of tests.
+
+ * DoYouEvenBench/Full.html:
+ * DoYouEvenBench/resources/main.css: Added.
+ * DoYouEvenBench/resources/main.js: Added.
+ (.addResult):
+ (window.benchmarkClient):
+ (startBenchmark): Renamed from startTest.
+
2014-06-01 Ryosuke Niwa <rniwa@webkit.org>
DYEBench: CSS parser warning at line 106 of base.css
<!DOCTYPE html>
<html>
<head>
-<title>DoYouEvenBench v0.15</title>
-<style type="text/css">
-caption { margin: 0; padding: 0; font-family: sans-serif; font-size: 1em; font-weight: bold; white-space: nowrap; }
-#progressContainer { padding: 605px 0 10px 0; width: 800px; }
-#progressContainer div { background-color: #ccc; width: 0; height: 5px; overflow: hidden; }
-table { font-family: sans-serif; }
-table, td, th { border: solid 1px #ccc; border-collapse: collapse; padding: 5px; }
-th { text-align: right; }
-td { text-align: left; }
-</style>
-<script>
-
-(function () {
- var values = [];
- var resultContainer = null;
- var title;
- var progressContainer;
- var progress;
- var iterationNumber = 0;
- var finishedTestCount = 0;
-
- function addResult(title, value) {
- if (!resultContainer) {
- resultContainer = document.createElement('table');
- var caption = document.createElement('caption');
- caption.textContent = document.title;
- resultContainer.appendChild(caption);
- document.body.appendChild(resultContainer);
- }
- if (!title)
- return;
- var row = document.createElement('tr');
- var th = document.createElement('th');
- th.textContent = title;
- var td = document.createElement('td');
- td.textContent = value;
- row.appendChild(th);
- row.appendChild(td);
- resultContainer.appendChild(row);
- }
-
- window.benchmarkClient = {
- iterationCount: 20,
- willRunTest: function () {
- if (!progress) {
- // We don't use the real progress element as some implementations animate it.
- progressContainer = document.createElement('div');
- progressContainer.appendChild(document.createElement('div'));
- progressContainer.id = 'progressContainer';
- document.body.appendChild(progressContainer);
- progress = progressContainer.firstChild;
- }
- addResult();
- },
- didRunTest: function () {
- finishedTestCount++;
- progress.style.width = (finishedTestCount * 100 / this.testsCount) + '%';
- },
- didRunSuites: function (measuredValues) {
- values.push(measuredValues.total);
- iterationNumber++;
- addResult('Iteration ' + iterationNumber, measuredValues.total.toFixed(2) + ' ms');
- },
- didFinishLastIteration: function () {
- var sum = values.reduce(function (a, b) { return a + b; }, 0);
- var arithmeticMean = sum / values.length;
- var meanLabel = arithmeticMean.toFixed(2) + ' ms';
- if (window.Statistics) {
- var delta = Statistics.confidenceIntervalDelta(0.95, values.length, sum, Statistics.squareSum(values));
- var precentDelta = delta * 100 / arithmeticMean;
- meanLabel += ' \xb1 ' + delta.toFixed(2) + ' ms (' + precentDelta.toFixed(2) + '%)';
- }
- addResult('Arithmetic Mean', meanLabel);
- progressContainer.parentNode.removeChild(progressContainer);
- }
- }
-})();
-
-function startTest() {
- var totalSubtestCount = Suites.reduce(function (testsCount, suite) { return testsCount + suite.tests.length; }, 0);
- benchmarkClient.testsCount = benchmarkClient.iterationCount * totalSubtestCount;
- var runner = new BenchmarkRunner(Suites, benchmarkClient);
- runner.runMultipleIterations(benchmarkClient.iterationCount);
-}
-
-</script>
-<script src="resources/benchmark-runner.js"></script>
-<script src="resources/benchmark-report.js"></script>
-<script src="../resources/statistics.js"></script>
-<script src="resources/tests.js"></script>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>DoYouEvenBench v0.16</title>
+ <link rel="stylesheet" href="resources/main.css">
+ <script src="resources/main.js" defer></script>
+ <script src="resources/benchmark-runner.js" defer></script>
+ <script src="resources/benchmark-report.js" defer></script>
+ <script src="../resources/statistics.js" defer></script>
+ <script src="resources/tests.js" defer></script>
</head>
-<body onload="startTest()">
+<body>
</body>
</html>
--- /dev/null
+caption { margin: 0; padding: 0; font-family: sans-serif; font-size: 1em; font-weight: bold; white-space: nowrap; }
+#progressContainer { padding: 605px 0 10px 0; width: 800px; }
+#progressContainer div { background-color: #ccc; width: 0; height: 5px; overflow: hidden; }
+table { font-family: sans-serif; }
+table, td, th { border: solid 1px #ccc; border-collapse: collapse; padding: 5px; }
+th { text-align: right; }
+td { text-align: left; }
--- /dev/null
+(function () {
+
+var values = [];
+var resultContainer = null;
+var title;
+var progressContainer;
+var progress;
+var iterationNumber = 0;
+var finishedTestCount = 0;
+
+function addResult(title, value) {
+ if (!resultContainer) {
+ resultContainer = document.createElement('table');
+ var caption = document.createElement('caption');
+ caption.textContent = document.title;
+ resultContainer.appendChild(caption);
+ document.body.appendChild(resultContainer);
+ }
+ if (!title)
+ return;
+ var row = document.createElement('tr');
+ var th = document.createElement('th');
+ th.textContent = title;
+ var td = document.createElement('td');
+ td.textContent = value;
+ row.appendChild(th);
+ row.appendChild(td);
+ resultContainer.appendChild(row);
+}
+
+window.benchmarkClient = {
+ iterationCount: 20,
+ willRunTest: function () {
+ if (!progress) {
+ // We don't use the real progress element as some implementations animate it.
+ progressContainer = document.createElement('div');
+ progressContainer.appendChild(document.createElement('div'));
+ progressContainer.id = 'progressContainer';
+ document.body.appendChild(progressContainer);
+ progress = progressContainer.firstChild;
+ }
+ addResult();
+ },
+ didRunTest: function () {
+ finishedTestCount++;
+ progress.style.width = (finishedTestCount * 100 / this.testsCount) + '%';
+ },
+ didRunSuites: function (measuredValues) {
+ values.push(measuredValues.total);
+ iterationNumber++;
+ addResult('Iteration ' + iterationNumber, measuredValues.total.toFixed(2) + ' ms');
+ },
+ didFinishLastIteration: function () {
+ var sum = values.reduce(function (a, b) { return a + b; }, 0);
+ var arithmeticMean = sum / values.length;
+ var meanLabel = arithmeticMean.toFixed(2) + ' ms';
+ if (window.Statistics) {
+ var delta = Statistics.confidenceIntervalDelta(0.95, values.length, sum, Statistics.squareSum(values));
+ var precentDelta = delta * 100 / arithmeticMean;
+ meanLabel += ' \xb1 ' + delta.toFixed(2) + ' ms (' + precentDelta.toFixed(2) + '%)';
+ }
+ addResult('Arithmetic Mean', meanLabel);
+ progressContainer.parentNode.removeChild(progressContainer);
+ }
+}
+
+})();
+
+function startBenchmark() {
+ var enabledSuites = Suites.filter(function (suite) { return !suite.disabled });
+ var totalSubtestCount = enabledSuites.reduce(function (testsCount, suite) { return testsCount + suite.tests.length; }, 0);
+ benchmarkClient.testsCount = benchmarkClient.iterationCount * totalSubtestCount;
+ var runner = new BenchmarkRunner(Suites, benchmarkClient);
+ runner.runMultipleIterations(benchmarkClient.iterationCount);
+}
+
+window.onload = startBenchmark;