Skip to content

Fast parsing and selector query #97

@VoidMonk

Description

@VoidMonk

Hi,

I'm trying the following code, but in some cases either the parsing or selector query (or both) are slower than CsQuery:

var config = new Configuration().WithDefaultLoader();
AngleSharp.Dom.Html.IHtmlDocument document;
AngleSharp.Dom.IHtmlCollection<AngleSharp.Dom.IElement> elements;

//  either the parsing or selector query (or both) are slower than CsQuery
document = new AngleSharp.Parser.Html.HtmlParser(html, config).Parse();
elements = document.QuerySelectorAll(selectorPath);

What configuration or other optimizations would result in the fastest parsing and selector query in AngleSharp? If it matters, I don't want to parse the CSS or JS, just the HTML.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions