Closed Stranger6667 closed 2 years ago
With lol-html
inlining is on average 2-2.5 faster, worth switching. Also with smallvec
there are more optimizations possibilities
Possible issue - lol_html
doesn't support pseudo-classes like a.bluelink:active
. probably we can just remove pseudoclasses and de-duplicate selectors
Selectors support in lol-html
differs from cssparser
significantly, so it boils down to extra performance vs correctness. Being already fast enough, and faster than alternatives (not in Rust, but e.g. CLI tools), I think it is better to keep the implementation based on cssparser
.
https://github.com/cloudflare/lol-html
I have a PoC that is kinda working for a simple case but need some benchmarking, CSS parsing code is the same