Skip to content

perf(html): inline parse functions#9609

Merged
ematipico merged 2 commits intomainfrom
perf/inline-html-parse-functions
Mar 25, 2026
Merged

perf(html): inline parse functions#9609
ematipico merged 2 commits intomainfrom
perf/inline-html-parse-functions

Conversation

@ematipico
Copy link
Copy Markdown
Member

Summary

Added #[inline] to small parsing functions in the HTML parser. If there are some savings in performance, i'll add a changeset

Test Plan

Green CI

Docs

@github-actions github-actions bot added A-Parser Area: parser L-HTML Language: HTML and super languages labels Mar 23, 2026
@ematipico ematipico requested review from a team March 23, 2026 18:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: be84bd09-836e-46aa-8521-aa95627d6932

📥 Commits

Reviewing files that changed from the base of the PR and between 085d324 and 5731b2e.

📒 Files selected for processing (4)
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_parser/src/syntax/astro.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs

Walkthrough

This pull request adds #[inline] compiler hints to various helper functions throughout the HTML parser codebase. The changes span the lexer module (affecting character advancement methods) and multiple syntax modules (Astro, Svelte, and general HTML parsing helpers). No logic, control flow, or function signatures are modified—only inlining attributes are introduced for potential performance optimisation.

Possibly related PRs

Suggested labels

A-Parser, L-HTML

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'perf(html): inline parse functions' clearly and concisely summarises the main change: adding inline attributes to HTML parser functions for performance optimisation.
Description check ✅ Passed The description directly relates to the changeset, explaining the motivation (performance optimisation) and test approach, though details are minimal.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/inline-html-parse-functions

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 23, 2026

Merging this PR will degrade performance by 16.54%

❌ 3 regressed benchmarks
✅ 64 untouched benchmarks
⏩ 152 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
html_analyzer[real/wikipedia-fr-Guerre_de_Canudos.html] 422.7 ms 454.4 ms -6.99%
html_analyzer[real/wikipedia-JavaScript.html] 162 ms 187.9 ms -13.8%
html_analyzer[real/wikipedia-Unix.html] 138.1 ms 165.4 ms -16.54%

Comparing perf/inline-html-parse-functions (8ac46d2) with main (085d324)

Open in CodSpeed

Footnotes

  1. 152 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

⚠️ No Changeset found

Latest commit: 8ac46d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the A-Project Area: project label Mar 23, 2026
@ematipico ematipico merged commit 27969fd into main Mar 25, 2026
16 of 17 checks passed
@ematipico ematipico deleted the perf/inline-html-parse-functions branch March 25, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser A-Project Area: project L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants