Repository navigation
perf(web): decode HTML tokenizer scan loop to bytes once - #896
Merged
Merged
Conversation
… call pp_html_us (HTML tokenize+tree build) was the largest parse-phase bucket per round 6 (doc/10_metrics/ui/web_perf_round6_2026-09-13.md), whose own .bytes()-based attempt regressed because it redecoded the whole remaining document on every _find_char/_find_substr call. This threads a single text_to_bytes(html) decode through the whole outer scan loop instead: _find_byte/_scan_char_data_b/_find_tag_close_b/_is_alpha_byte index that one pre-decoded [u8] array per probe rather than allocating a length-1 text via html.slice(pos, pos+1) or re-decoding bytes per call. A/B (8-page catalog, 4 alternating pairs): pp_html_us -5.5%/-4.6%/+0.6%/-10.2%, Draw-IR digest byte-identical all 8 pairs both sides. html_tokenizer specs unchanged (abrupt_comment 4/4, unit mirror 17/17; the 23/53-passing spec's 30-example failure set is confirmed pre-existing and byte-identical before vs after). GPU boundary audit PASS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi
ormastes
had a problem deploying
to
self-review-admission
September 13, 2026 11:32 — with
GitHub Actions
Error
5 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pp_html_us(HTML tokenize+tree build) was round 6's largest parse-phase bucket; its own.bytes()-based attempt regressed because it redecoded the whole remaining document on every_find_char/_find_substrcall.html.bytes()once per document at the top ofhtml_tokenizer_tokenize_with_limitsand threads that single[u8]array through the hot scan loop (_find_byte,_scan_char_data_b,_find_tag_close_b,_is_alpha_byte) instead of allocating atextslice or redecoding per character/call.doc/10_metrics/ui/web_perf_round7b_2026-09-13.md.Test plan
test/05_perf/ui/web/pipeline_bench.spl:pp_html_us-5.5%/-4.6%/+0.6%/-10.2%, Draw-IR digest byte-identical all 8 pairs both sidestest/01_unit/browser_engine/html_tokenizer_abrupt_comment_spec.spl4/4 pass, identical both sidestest/unit/browser_engine/html_tokenizer_spec.spl17/17 pass, identical both sidestest/01_unit/browser_engine/html_tokenizer_spec.spl23/53-passing baseline confirmed pre-existing and byte-identical failure set before/aftercheck-no-conflict-markers-push,check-tree-size-push,check-test-tree-divergence-deltaall PASS, 0 new divergence🤖 Generated with Claude Code
https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi