Skip to content

Don't clone input buffer inside html5ever benchmark loop #634

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

Merged
merged 2 commits into from
Jun 27, 2025

Conversation

simonwuelker
Copy link
Contributor

@simonwuelker simonwuelker commented Jun 26, 2025

This clone operation should not be counted towards the benchmark time. When the benchmark was written criterion did not support per-iteration setup, but now it does using Bencher::iter_batched. Using this method reduces the benchmark time by 9% in lipsum.html.

Additionally, the way html5ever was used inside the benchmarks was wrong if there were <script> elements in the input.
To fully tokenize input in html5ever, you need to spin on the Tokenizer::feed method until it returns Done.
None of our benchmarks contain any script elements, but it's better to fix it anyways.

@simonwuelker simonwuelker added this pull request to the merge queue Jun 27, 2025
Merged via the queue into servo:main with commit 6d0d9bb Jun 27, 2025
6 checks passed
@simonwuelker simonwuelker deleted the benchmarks branch June 27, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants