No bug - Remove unnecessary console.log calls from Cleopatra code; r=dcamp

This commit is contained in:
Anton Kovalyov 2013-07-10 18:28:10 -07:00
parent b919e9d555
commit 3bccfad489
3 changed files with 3 additions and 24 deletions

View File

@ -51,8 +51,7 @@ function WorkerRequest(worker) {
var startTime = Date.now(); var startTime = Date.now();
var data = msg.data; var data = msg.data;
var readTime = Date.now() - startTime; var readTime = Date.now() - startTime;
if (readTime > 10)
console.log("reading data from worker message: " + readTime + "ms");
if (data.requestID == requestID || !data.requestID) { if (data.requestID == requestID || !data.requestID) {
switch(data.type) { switch(data.type) {
case "error": case "error":
@ -125,8 +124,6 @@ WorkerRequest.prototype = {
taskData: taskData taskData: taskData
}); });
var postTime = Date.now() - startTime; var postTime = Date.now() - startTime;
if (true || postTime > 10)
console.log("posting message to worker: " + postTime + "ms");
this._sendChunkReporter.finish(); this._sendChunkReporter.finish();
this._executeReporter.begin("Processing worker request..."); this._executeReporter.begin("Processing worker request...");
}, },
@ -164,8 +161,6 @@ WorkerRequest.prototype = {
var startTime = Date.now(); var startTime = Date.now();
self._worker.postMessage(msg); self._worker.postMessage(msg);
var postTime = Date.now() - startTime; var postTime = Date.now() - startTime;
if (postTime > 10)
console.log("posting message to worker: " + postTime + "ms");
self._sendChunkReporter.setProgress((msgIndex + 1) / totalMessages); self._sendChunkReporter.setProgress((msgIndex + 1) / totalMessages);
} }
var messagePostingTimer = 0; var messagePostingTimer = 0;
@ -214,7 +209,6 @@ WorkerRequest.prototype = {
var Parser = { var Parser = {
parse: function Parser_parse(data, params) { parse: function Parser_parse(data, params) {
console.log("profile num chars: " + data.length);
var request = new WorkerRequest(gParserWorker); var request = new WorkerRequest(gParserWorker);
request.sendInChunks("parseRawProfile", data, params, 3000000); request.sendInChunks("parseRawProfile", data, params, 3000000);
return request; return request;

View File

@ -177,7 +177,6 @@ TreeView.prototype = {
}, },
// Take a selection snapshot and restore the selection // Take a selection snapshot and restore the selection
restoreSelectionSnapshot: function TreeView_restoreSelectionSnapshot(snapshot, allowNonContigious) { restoreSelectionSnapshot: function TreeView_restoreSelectionSnapshot(snapshot, allowNonContigious) {
//console.log("restore selection: " + JSON.stringify(snapshot));
var currNode = this._horizontalScrollbox.firstChild; var currNode = this._horizontalScrollbox.firstChild;
if (currNode.data.name == snapshot[0] || snapshot[0] == "(total)") { if (currNode.data.name == snapshot[0] || snapshot[0] == "(total)") {
snapshot.shift(); snapshot.shift();
@ -188,7 +187,6 @@ TreeView.prototype = {
this._syncProcessPendingActionProcessing(); this._syncProcessPendingActionProcessing();
for (var i = 0; i < currNode.treeChildren.length; i++) { for (var i = 0; i < currNode.treeChildren.length; i++) {
if (currNode.treeChildren[i].data.name == snapshot[0]) { if (currNode.treeChildren[i].data.name == snapshot[0]) {
//console.log("Found: " + currNode.treeChildren[i].data.name + "\n");
snapshot.shift(); snapshot.shift();
this._toggle(currNode, false, true); this._toggle(currNode, false, true);
currNode = currNode.treeChildren[i]; currNode = currNode.treeChildren[i];
@ -200,7 +198,6 @@ TreeView.prototype = {
var pendingSearch = [currNode.data]; var pendingSearch = [currNode.data];
while (pendingSearch.length > 0) { while (pendingSearch.length > 0) {
var node = pendingSearch.shift(); var node = pendingSearch.shift();
//console.log("searching: " + node.name + " for: " + snapshot[0] + "\n");
if (!node.treeChildren) if (!node.treeChildren)
continue; continue;
for (var i = 0; i < node.treeChildren.length; i++) { for (var i = 0; i < node.treeChildren.length; i++) {

View File

@ -627,7 +627,6 @@ RangeSelector.prototype = {
}, },
// echo the location off the mouse on the histogram // echo the location off the mouse on the histogram
drawMouseMarker: function RangeSelector_drawMouseMarker(x) { drawMouseMarker: function RangeSelector_drawMouseMarker(x) {
console.log("Draw");
var mouseMarker = this._mouseMarker; var mouseMarker = this._mouseMarker;
mouseMarker.style.left = x + "px"; mouseMarker.style.left = x + "px";
}, },
@ -814,12 +813,10 @@ window.onpopstate = function(ev) {
return; // Conflicts with document url return; // Conflicts with document url
if (!gBreadcrumbTrail) if (!gBreadcrumbTrail)
return; return;
console.log("pop: " + JSON.stringify(ev.state));
gBreadcrumbTrail.pop(); gBreadcrumbTrail.pop();
if (ev.state) { if (ev.state) {
console.log("state");
if (ev.state.action === "popbreadcrumb") { if (ev.state.action === "popbreadcrumb") {
console.log("bread");
//gBreadcrumbTrail.pop(); //gBreadcrumbTrail.pop();
} }
} }
@ -908,8 +905,7 @@ BreadcrumbTrail.prototype = {
//var state = {action: "popbreadcrumb",}; //var state = {action: "popbreadcrumb",};
//window.history.pushState(state, "Cleopatra"); //window.history.pushState(state, "Cleopatra");
} }
if (!li)
console.log("li at index " + index + " is null!");
delete li.breadcrumbIsTransient; delete li.breadcrumbIsTransient;
li.classList.add("selected"); li.classList.add("selected");
this._deleteBeyond(index); this._deleteBeyond(index);
@ -1469,7 +1465,6 @@ function loadRawProfile(reporter, rawProfile, profileId) {
reporter.setProgress(progress); reporter.setProgress(progress);
}); });
parseRequest.addEventListener("finished", function (result) { parseRequest.addEventListener("finished", function (result) {
console.log("parsing (in worker): " + (Date.now() - startTime) + "ms");
reporter.finish(); reporter.finish();
gMeta = result.meta; gMeta = result.meta;
gNumSamples = result.numSamples; gNumSamples = result.numSamples;
@ -1518,7 +1513,6 @@ function toggleInvertCallStack() {
gInvertCallstack = !gInvertCallstack; gInvertCallstack = !gInvertCallstack;
var startTime = Date.now(); var startTime = Date.now();
viewOptionsChanged(); viewOptionsChanged();
console.log("invert time: " + (Date.now() - startTime) + "ms");
} }
var gMergeUnbranched = false; var gMergeUnbranched = false;
@ -1675,7 +1669,6 @@ function enterProgressUI() {
totalProgressReporter.addListener(function (r) { totalProgressReporter.addListener(function (r) {
var progress = r.getProgress(); var progress = r.getProgress();
progressLabel.innerHTML = r.getAction(); progressLabel.innerHTML = r.getAction();
console.log("Action: " + r.getAction());
if (isNaN(progress)) if (isNaN(progress))
progressBar.removeAttribute("value"); progressBar.removeAttribute("value");
else else
@ -1852,7 +1845,6 @@ function filtersChanged() {
}); });
var start = Date.now(); var start = Date.now();
updateRequest.addEventListener("finished", function (filteredSamples) { updateRequest.addEventListener("finished", function (filteredSamples) {
console.log("profile filtering (in worker): " + (Date.now() - start) + "ms.");
gCurrentlyShownSampleData = filteredSamples; gCurrentlyShownSampleData = filteredSamples;
gInfoBar.display(); gInfoBar.display();
@ -1860,7 +1852,6 @@ function filtersChanged() {
start = Date.now(); start = Date.now();
gPluginView.display(gSampleFilters[gSampleFilters.length-1].pluginName, gSampleFilters[gSampleFilters.length-1].param, gPluginView.display(gSampleFilters[gSampleFilters.length-1].pluginName, gSampleFilters[gSampleFilters.length-1].param,
gCurrentlyShownSampleData, gHighlightedCallstack); gCurrentlyShownSampleData, gHighlightedCallstack);
console.log("plugin displaying: " + (Date.now() - start) + "ms.");
} else { } else {
gPluginView.hide(); gPluginView.hide();
} }
@ -1872,7 +1863,6 @@ function filtersChanged() {
gHistogramView.display(data.histogramData, data.frameStart, data.widthSum, gHighlightedCallstack); gHistogramView.display(data.histogramData, data.frameStart, data.widthSum, gHighlightedCallstack);
if (gFrameView) if (gFrameView)
gFrameView.display(data.histogramData, data.frameStart, data.widthSum, gHighlightedCallstack); gFrameView.display(data.histogramData, data.frameStart, data.widthSum, gHighlightedCallstack);
console.log("histogram displaying: " + (Date.now() - start) + "ms.");
}); });
if (gDiagnosticBar) { if (gDiagnosticBar) {
@ -1880,7 +1870,6 @@ function filtersChanged() {
diagnosticsRequest.addEventListener("finished", function (diagnosticItems) { diagnosticsRequest.addEventListener("finished", function (diagnosticItems) {
start = Date.now(); start = Date.now();
gDiagnosticBar.display(diagnosticItems); gDiagnosticBar.display(diagnosticItems);
console.log("diagnostic items displaying: " + (Date.now() - start) + "ms.");
}); });
} }
@ -1897,7 +1886,6 @@ function viewOptionsChanged() {
updateViewOptionsRequest.addEventListener("finished", function (calltree) { updateViewOptionsRequest.addEventListener("finished", function (calltree) {
var start = Date.now(); var start = Date.now();
gTreeManager.display(calltree, gSymbols, gFunctions, gResources, gMergeFunctions, filterNameInput && filterNameInput.value); gTreeManager.display(calltree, gSymbols, gFunctions, gResources, gMergeFunctions, filterNameInput && filterNameInput.value);
console.log("tree displaying: " + (Date.now() - start) + "ms.");
}); });
} }