Giter Club home page Giter Club logo

benchmark-html-parser-libraries's People

Contributors

acrazing avatar andreasmadsen avatar fb55 avatar munawwar avatar victornpb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

biobut

benchmark-html-parser-libraries's Issues

Clarify that it's for HTML string parsing only

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

Test setup instantiates a new parser for every file

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();
	});
};

How to test my own html parser?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.