victornpb / benchmark-html-parser-libraries Goto Github PK
View Code? Open in Web Editor NEWA Benchmark of javascript libraries for parsing HTML (CPU/RAM)
License: MIT License
A Benchmark of javascript libraries for parsing HTML (CPU/RAM)
License: MIT License
this test setup does not support html streaming which is imho one of the biggest speed factors... as parsing can be already done when you have finished reading the file...(the beauty of a declarative language like html)
But yeah if you do get the html as a string and do not read it from the file system (which can be streamed) then it totally makes sense...
but it should be clarified that a comparison where you get the raw string and streaming is impossible is the goal here
in my experience a very fast parser. I currently process 800+ html files within 3s (I'm only reading a few attributes)
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();
});
};
Hey, Im currently developing an html parser and in my own benchmarks it was 2-3x times faster then the current top tiers, How Can I test my own html parser with this package?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.