From 9b4cd3e306b9b721c86cdeea2b15d5529a569ec5 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 10 Jan 2014 14:27:21 +0000 Subject: [PATCH] Some more profiling helpers - timeline timestamp at start of rendering, consistently measure to end of app callback --- etemplate/js/etemplate2.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 122c86b1e1..73ff791bba 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -267,6 +267,10 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) var _load = function() { egw.debug("log", "Loading template..."); + if(console.timeStamp) + { + console.timeStamp("Begin rendering template"); + } // Add into indexed list - do this before, so anything looking can find it, // even if it's not loaded @@ -292,14 +296,6 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) { egw.window.console.groupEnd(); } - if(console.timelineEnd) - { - console.timelineEnd(_name); - } - if(console.profileEnd) - { - console.profileEnd(_name); - } if(deferred.length > 0) { var still_deferred = 0; @@ -329,6 +325,15 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) $j(this.DOMContainer).trigger('load', this); + // Profiling + if(console.timelineEnd) + { + console.timelineEnd(_name); + } + if(console.profileEnd) + { + console.profileEnd(_name); + } var end_time = (new Date).getTime(); var gen_time_div = $j('#divGenTime_'+appname); if (!gen_time_div.length) gen_time_div = $j('.pageGenTime');