summaryrefslogtreecommitdiff
path: root/js/lib/html.js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-10 21:33:25 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-10 21:34:04 -0800
commit958505853ebd24fd3c0dc2bc6f6fb0615a48c8b7 (patch)
treeeb949684782940565b5e1c4dbadbbaa6cdddbff8 /js/lib/html.js
parentf5476eb652b7d69ed25c858a4d757b9313b40b67 (diff)
Added options to DocParser.
So far only 'time' is supported. 'time' now gives a breakdown of block parsing, inline parsing, and rendering. Currently the ratio is block parsing: 725ms inline parsing: 332ms rendering: 213ms so perhaps block.js is the best place to look for further optimizations.
Diffstat (limited to 'js/lib/html.js')
-rw-r--r--js/lib/html.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/js/lib/html.js b/js/lib/html.js
index a985039..847ed98 100644
--- a/js/lib/html.js
+++ b/js/lib/html.js
@@ -50,6 +50,8 @@ var renderNodes = function(block) {
var options = this.options;
+ if (options.time) { console.time("rendering"); }
+
while ((event = walker.next())) {
entering = event.entering;
node = event.node;
@@ -225,6 +227,7 @@ var renderNodes = function(block) {
}
}
+ if (options.time) { console.timeEnd("rendering"); }
return buffer;
};