perf(runtime-tags): stop materializing branch boundary nodes - #3712
Open
DylanPiercey wants to merge 2 commits into
Open
perf(runtime-tags): stop materializing branch boundary nodes#3712DylanPiercey wants to merge 2 commits into
DylanPiercey wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 3778f47 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3712 +/- ##
==========================================
+ Coverage 90.34% 90.35% +0.01%
==========================================
Files 414 414
Lines 19746 19833 +87
Branches 3615 3652 +37
==========================================
+ Hits 17840 17921 +81
- Misses 1367 1370 +3
- Partials 539 542 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DylanPiercey
marked this pull request as ready for review
July 30, 2026 21:43
DylanPiercey
force-pushed
the
dpiercey-ws-marko-comments-optimization-lfdet4
branch
from
July 30, 2026 21:44
e45bdf8 to
4f592ea
Compare
DylanPiercey
force-pushed
the
dpiercey-ws-marko-comments-optimization-lfdet4
branch
2 times, most recently
from
July 31, 2026 16:16
329a5d1 to
1a607af
Compare
Client rendered templates no longer pad the ends of a template or branch body whose edge is `if`/`for`/dynamic tag content, and resuming a server rendered branch adopts its real edge nodes instead of retaining the start comment and inserting a text node. `fixBranchEdges` keeps owner ranges valid by repairing their endpoints as nested content moves; debug builds assert range validity at every range read so a missed repair fails loudly. `<show>`, `<await>` and `<try>` own their anchors — a `<show>` body is inlined into the enclosing scope and the others move their anchors themselves — so the branch chain cannot repair their ranges. They keep their padding and markers, and instead repair their owner's edges when they detach, swap in a placeholder, or resolve.
DylanPiercey
force-pushed
the
dpiercey-ws-marko-comments-optimization-lfdet4
branch
from
July 31, 2026 16:33
1a607af to
fe19ed3
Compare
Server rendered `if`/`for` branches whose top-level content is statically countable (native tags, html comments, countable custom tags) no longer write a start comment per branch: the end marker's new `BranchEndCounted` symbol carries the per-branch node count and resume walks the range back from the end, generalizing the single-node encoding. An N item loop drops N start comments (~7% of a compressed list page); costs ~2B brotli of runtime.
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.
Control flow boundaries no longer leave permanent nodes behind, and countable ones stop shipping start comments entirely.
Commit 1: Client rendered templates stop padding the ends of a template or branch body whose edge is
if/for/dynamic tag content, and resuming a server rendered branch adopts its real edge nodes rather than retaining the start comment and inserting a text node. A newfixBranchEdgeskeeps owner ranges valid by repairing their endpoints as nested content moves; debug builds assert range validity at every range read.<show>,<await>and<try>keep their own anchors — a<show>body is inlined into the enclosing scope and the others move their anchors themselves — so they repair their owner's edges rather than being repaired. Costs ~69B brotli of runtime; halves the marker nodes in a resumed page.Commit 2: Building on that, server rendered
if/forbranches whose top-level content is statically countable no longer write a start comment per branch — the end marker's newBranchEndCountedsymbol carries the per-branch node count and resume walks the range back from the end, generalizing the single-node encoding. An N item loop drops N start comments (~7% of a compressed list page); ~2B brotli of runtime.