Skip to content

perf(format/html): replace string comparisons with token set checks - #11355

Draft
dyc3 wants to merge 1 commit into
mainfrom
dyc3/refactor-html-fmt-token-sets
Draft

perf(format/html): replace string comparisons with token set checks#11355
dyc3 wants to merge 1 commit into
mainfrom
dyc3/refactor-html-fmt-token-sets

Conversation

@dyc3

@dyc3 dyc3 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The main purpose of this PR was to refactor the HTML formatter to get rid of most string comparisons and related possible memory allocations. However, it turned out there were some bugs, and I just went ahead and fixed those because it made the code more simple.

On my machine, I got a ~1-3% perf improvement

implemented by gpt 5.6 sol

Test Plan

snapshots

Docs

@changeset-bot

changeset-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2235b73

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Organic activity

No automation signals detected in the analyzed events.

View full analysis →

This is an automated analysis by AgentScan

@github-actions github-actions Bot added A-Formatter Area: formatter L-HTML Language: HTML and super languages labels Aug 15, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 15, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.45%

❌ 3 (👁 3) regressed benchmarks
✅ 64 untouched benchmarks
⏩ 234 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
👁 html_analyzer[real/wikipedia-fr-Guerre_de_Canudos.html] 1.1 s 1.2 s -6.55%
👁 html_analyzer[real/wikipedia-Unix.html] 440.7 ms 471.4 ms -6.52%
👁 html_analyzer[real/wikipedia-JavaScript.html] 535 ms 570.8 ms -6.29%

Comparing dyc3/refactor-html-fmt-token-sets (2235b73) with main (b63987a)

Open in CodSpeed

Footnotes

  1. 234 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant