Open daKmoR opened 3 years ago
I think many parsers are built so they can parse multiple html files one after another while using the same instance.
I assume you will get fastly different numbers if you rewrite this https://github.com/victornpb/benchmark-html-parser-libraries/blob/master/tests/sax.js
const sax = require("sax"); module.exports = function (html) { return new Promise((resolve, reject) => { const parser = sax.parser(false); parser.onend = resolve; parser.onerror = reject; parser.write(html); parser.close(); }); };
to something like this
const sax = require("sax"); const parser = sax.parser(false); module.exports = function (html) { return new Promise((resolve, reject) => { parser.onend = resolve; parser.onerror = reject; parser.write(html); parser.close(); }); };
You're right, i'm gonna change it!
I think many parsers are built so they can parse multiple html files one after another while using the same instance.
I assume you will get fastly different numbers if you rewrite this https://github.com/victornpb/benchmark-html-parser-libraries/blob/master/tests/sax.js
to something like this