-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WHATWG-compliant? #34
Comments
thanks for bringing this up, it's a good point and I think it's important to add this to the README. Seems a little unfair to make crates like html5ever look "bad" in the benchmarks even though the reason for that is probably that they closely follow the spec as you say, and comparing it to this crate. This is mentioned in the separate benchmark repo (linked in the README), but it's kind of hidden behind a wall of text (and not mentioned here), which is unfortunate. |
There's nothing in tl right now that documents the spec compliance status (whether it tries to follow it or not, see #34). This PR adds some information to the README regarding this, and changes the benchmark section. It should be a lot clearer which parsers attempt to comply with the specification and which ones don't, as well as making it clear that it's more of a theoretical benchmark and doesn't necessarily say something meaningful (at least comparing tl to html5ever and lol-html), since the performance of a parser that attempts to follow the specification can't be compared to one that doesn't (due to the fact that the spec really limits what one can do).
I added a few things to the README, hoping that it makes the goals of this crate more clear. I've also fixed the benchmarks section up a bit. The table now has a column for "follows spec" (whether compliance with the spec is a goal) and a "note", saying that it's important to understand what difference it makes for performance if one isn't bound to a specification. |
Does this parser attempt to follow the spec that browsers follow?
Rust crates that follow WHATWG (I think this list is complete):
In its benchmarking suite,
tl
compares itself against both kinds of parsers, ones that do attempt to comply to the WHATWG spec and parsers who don't. Since WHATWG defines error-recovery etc very precisely, that influences what kind of optimizations one can do, and explains why html5ever is slow.The text was updated successfully, but these errors were encountered: