-
Notifications
You must be signed in to change notification settings - Fork 135
Don't use utf8 logic to parse unquoted urls. #110
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
Conversation
This makes the benchmark I added go from: 580,075 ns/iter (+/- 15,881) to 261,823 ns/iter (+/- 11,536) |
r? @SimonSapin |
Looks good! Could you do the same for quoted strings? Thanks |
d7bcfa1
to
ce22a3e
Compare
Done. Note that we could also add this fast path when escapes are present, but that includes using |
Yeah, I don't have data on this but I suspect that CSS escapes are not very common. |
c8d1c19
to
ef0858f
Compare
Reviewed 2 of 3 files at r3, 1 of 1 files at r4, 1 of 1 files at r5. src/tests.rs, line 586 at r5 (raw file):
Please move this to a separate src/tokenizer.rs, line 857 at r5 (raw file):
Nit: src/tokenizer.rs, line 1016 at r5 (raw file):
Nit: the Comments from Reviewable |
Current values: test tests::unquoted_url ... bench: 580,075 ns/iter (+/- 15,881)
261,823 ns/iter (+/- 11,536)
5230756
to
ed27364
Compare
Addressed all review comments except the
And i can't use |
If this is still too slow, the other thing to do would be to use table lookup to scan the properties of the given byte in all these hot loops.
@bors-servo r+ Reviewed 3 of 4 files at r6, 1 of 1 files at r7. Comments from Reviewable |
📌 Commit 673623f has been approved by |
Don't use utf8 logic to parse unquoted urls. Since it's not needed, and it's noticeable when parsing large data-uris, like servo/servo#13778. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-cssparser/110) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Since it's not needed, and it's noticeable when parsing large data-uris, like servo/servo#13778.
This change is