aboutsummaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>2011-11-07 10:14:12 +0000
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>2011-11-07 10:14:12 +0000
commitc3b37129d6387b2db313f9100256d2d5f60dd9a8 (patch)
tree84fc82a1ecb5b73234f42051ec7a012a94bd1ff3 /benchmarks
parentbecbc5247ca44bb32846a82794e96425980e9d50 (diff)
downloadv8-c3b37129d6387b2db313f9100256d2d5f60dd9a8.tar.gz
Version 3.7.4
Proper "libv8.so.3.7.4" SONAME for Linux shared library (issue 1786). Fix Harmony sets and maps to allow null and undefined as keys (still hidden behind --harmony flag) (issue 1622). Implement VirtualMemory on FreeBSD to fix build (issue 1807). Enable VFP instructions for Android. Fix error handling in Date.prototype.toISOString (issue 1792). Bug fixes and performance improvements for all platforms. Not officially supported but noteworthy: Crankshaft for MIPS :-) git-svn-id: http://v8.googlecode.com/svn/trunk@9889 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/spinning-balls/v.js78
1 files changed, 73 insertions, 5 deletions
diff --git a/benchmarks/spinning-balls/v.js b/benchmarks/spinning-balls/v.js
index 87366d939..d8a5e2a15 100644
--- a/benchmarks/spinning-balls/v.js
+++ b/benchmarks/spinning-balls/v.js
@@ -57,6 +57,11 @@ var renderingStartTime = void 0;
var scene = void 0;
var pausePlot = void 0;
var splayTree = void 0;
+var numberOfFrames = 0;
+var sumOfSquaredPauses = 0;
+var benchmarkStartTime = void 0;
+var benchmarkTimeLimit = void 0;
+var pauseDistribution = [];
function Point(x, y, z, payload) {
@@ -343,9 +348,43 @@ Scene.prototype.draw = function () {
};
+function updateStats(pause) {
+ numberOfFrames++;
+ if (pause > 20) {
+ sumOfSquaredPauses += (pause - 20) * (pause - 20);
+ }
+ pauseDistribution[Math.floor(pause / 10)] |= 0;
+ pauseDistribution[Math.floor(pause / 10)]++;
+}
+
+
+function renderStats() {
+ var msg = document.createElement("p");
+ msg.innerHTML = "Score " +
+ Math.round(numberOfFrames * 1000 / sumOfSquaredPauses);
+ var table = document.createElement("table");
+ table.align = "center";
+ for (var i = 0; i < pauseDistribution.length; i++) {
+ if (pauseDistribution[i] > 0) {
+ var row = document.createElement("tr");
+ var time = document.createElement("td");
+ var count = document.createElement("td");
+ time.innerHTML = i*10 + "-" + (i+1)*10 + "ms";
+ count.innerHTML = " => " + pauseDistribution[i];
+ row.appendChild(time);
+ row.appendChild(count);
+ table.appendChild(row);
+ }
+ }
+ div.appendChild(msg);
+ div.appendChild(table);
+}
+
+
function render() {
if (typeof renderingStartTime === 'undefined') {
renderingStartTime = Date.now();
+ benchmarkStartTime = renderingStartTime;
}
ModifyPointsSet();
@@ -359,12 +398,36 @@ function render() {
pausePlot.draw();
+ updateStats(pause);
+
div.innerHTML =
livePoints.count + "/" + dyingPoints.count + " " +
- pause + "(max = " + pausePlot.maxPause + ") ms" ;
+ pause + "(max = " + pausePlot.maxPause + ") ms " +
+ numberOfFrames + " frames";
+
+ if (renderingEndTime < benchmarkStartTime + benchmarkTimeLimit) {
+ // Schedule next frame.
+ requestAnimationFrame(render);
+ } else {
+ renderStats();
+ }
+}
- // Schedule next frame.
- requestAnimationFrame(render);
+
+function renderForm() {
+ form = document.createElement("form");
+ form.setAttribute("action", "javascript:start()");
+ var label = document.createTextNode("Time limit in seconds ");
+ var input = document.createElement("input");
+ input.setAttribute("id", "timelimit");
+ input.setAttribute("value", "60");
+ var button = document.createElement("input");
+ button.setAttribute("type", "submit");
+ button.setAttribute("value", "Start");
+ form.appendChild(label);
+ form.appendChild(input);
+ form.appendChild(button);
+ document.body.appendChild(form);
}
@@ -382,6 +445,11 @@ function init() {
pausePlot = new PausePlot(480, 240, 160);
}
+function start() {
+ benchmarkTimeLimit = document.getElementById("timelimit").value * 1000;
+ document.body.removeChild(form);
+ init();
+ render();
+}
-init();
-render();
+renderForm();