aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-19 17:14:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-19 17:14:59 -0700
commitc7a6dd4ab312a91d218a99a017dea29d8d62941c (patch)
tree17c604a86f777240c6b8d7bd24e38b42267abd02
parent43138933841d7075c2571345f3ffc48dcebeaf44 (diff)
client perf debugging
-rw-r--r--src/proxyClient.js19
-rw-r--r--src/webGLClient.js1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/proxyClient.js b/src/proxyClient.js
index 30fe3850..90949673 100644
--- a/src/proxyClient.js
+++ b/src/proxyClient.js
@@ -22,6 +22,25 @@ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequest
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame ||
renderFrame;
+/*
+var trueRAF = window.requestAnimationFrame;
+var lastRAF = 0;
+var meanFPS = 0;
+window.requestAnimationFrame = function(func) {
+ trueRAF(function() {
+ var now = performance.now();
+ if (lastRAF > 0) {
+ var diff = now - lastRAF;
+ var fps = 1000/diff;
+ meanFPS = 0.99*meanFPS + 0.1*fps;
+ dump('client fps ' + meanFPS + '\n');
+ }
+ lastRAF = now;
+ func();
+ });
+}
+*/
+
// end render
// Frame throttling
diff --git a/src/webGLClient.js b/src/webGLClient.js
index 6c2238b3..266d7cfe 100644
--- a/src/webGLClient.js
+++ b/src/webGLClient.js
@@ -92,6 +92,7 @@ function WebGLClient() {
function renderAllCommands() {
// TODO: we can avoid running commands from buffers that are not the last, if they
// have no side effects, as each buffer is from a different frame
+ //if (commandBuffers.length > 1) dump('extra buffs: ' + (commandBuffers.length-1) + '\n');
for (var i = 0; i < commandBuffers.length; i++) {
renderCommands(commandBuffers[i]);
}