aboutsummaryrefslogtreecommitdiff
path: root/src/intertyper.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-27 21:42:06 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-27 21:42:06 -0700
commit9a7389a86d9209e9fdda6da6578a7acdcf590eb1 (patch)
treebcd202c138ac20b5beeff6ced45d371f1e023b9b /src/intertyper.js
parent1f2058f6ecb8212986fa6566b966454268bdb972 (diff)
improve intertyper profiler
Diffstat (limited to 'src/intertyper.js')
-rw-r--r--src/intertyper.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index ce33a2d1..5ffc20dd 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -1099,8 +1099,12 @@ function intertyper(lines, sidePass, baseLineNums) {
var t = tokenizer(line);
item = triager(t);
- //var type = item ? item.intertype + (item.op ? ':' + item.op : ''): 'none';
- //interProf[type] = (interProf[type] || 0) + Date.now() - time;
+ /*
+ var type = item ? item.intertype + (item.op ? ':' + item.op : ''): 'none';
+ if (!interProf[type]) interProf[type] = { ms: 0, n: 0 };
+ interProf[type].ms += Date.now() - time;
+ interProf[type].n++;
+ */
if (!item) return;
finalResults.push(item);
@@ -1109,10 +1113,12 @@ function intertyper(lines, sidePass, baseLineNums) {
return finalResults;
}
+// intertyper profiler
+
/*
var interProf = {};
function dumpInterProf() {
- printErr('\nintertyper/' + phase + ' : ' + JSON.stringify(keys(interProf).sort(function(x, y) { return interProf[y] - interProf[x] }).map(function(x) { return x + ':' + interProf[x] }), null, ' ') + '\n');
+ printErr('\nintertyper/' + phase + ' (ms | n): ' + JSON.stringify(keys(interProf).sort(function(x, y) { return interProf[y].ms - interProf[x].ms }).map(function(x) { return x + ' : ' + interProf[x].ms + ' | ' + interProf[x].n }), null, ' ') + '\n');
}
*/