summaryrefslogtreecommitdiff
path: root/js/bench.js
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2015-01-08 10:21:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-09 10:15:23 -0800
commite564e0af5c2f7b9732e89707655068e507579a89 (patch)
treea9908e1340ce4cf3f1bfd73d85db844151966423 /js/bench.js
parent6b8f1433347557076140afb35ef4d9f036a658f9 (diff)
Use linked list instead of arrays for AST.
Use the same doubly linked node structure that cmark uses. The primary advantages of this change are (a) simplified code, especially in the renderers, and (b) elimination of the need for recursion, so we can render deeply-nested structures without a stack overflow. A node walker has also been added, for easy AST traversal. * Added js/lib/node.js for nodes. Includes a node walker. * All modules updated to use node structures. * Regularized position information into pos property. * Performance is slightly worse than before, but only marginally, and no doubt there are more optimizations that can be done.
Diffstat (limited to 'js/bench.js')
-rw-r--r--js/bench.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/bench.js b/js/bench.js
index 77f5025..a5e0d91 100644
--- a/js/bench.js
+++ b/js/bench.js
@@ -17,7 +17,7 @@ suite.add('commonmark.js markdown->html', function() {
"use strict";
var doc = new sm.DocParser().parse(contents);
var renderer = new sm.HtmlRenderer();
- renderer.renderBlock(doc);
+ renderer.render(doc);
})
.add('showdown.js markdown->html', function() {