perf: eliminate O(N^2) DomSlot chain traversal in BList#4090
Closed
Madoshakalaka wants to merge 1 commit intomasterfrom
Closed
perf: eliminate O(N^2) DomSlot chain traversal in BList#4090Madoshakalaka wants to merge 1 commit intomasterfrom
Madoshakalaka wants to merge 1 commit intomasterfrom
Conversation
Add parent-link notification to DynamicDomSlot and per-child position slots to BList. When a component's own_position is reassigned, the parent link eagerly resolves and propagates the concrete Node to the BList's child_slot. The NodeWriter then uses child_slot.to_position() (depth 1) instead of chaining through own_position (depth O(N)). This bounds DomSlot chain depth to O(1) per hop, reducing total reconciliation cost from O(N^2) to O(N) for lists of N children.
|
Visit the preview URL for this PR (updated for commit 3e535fc): https://yew-rs-api--pr4090-perf-blist-o1-domslo-lfoojkz9.web.app (expires Sun, 05 Apr 2026 16:02:30 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Benchmark - coreYew MasterPull Request |
Size ComparisonDetails
|
Benchmark - SSRYew MasterDetails
Pull RequestDetails
|
Member
Author
|
Nvm, cannot make it work lol. |
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.
This adds parent-link notification to
DynamicDomSlot: whenreassignis called and a parent is set, the resolved position is eagerly propagated.BListnow maintains per-childDynamicDomSlots (rev_child_slots) that are always eagerly resolved to concrete DOM nodes.During reconciliation, the
NodeWriteruseschild_slot.to_position()(constant depth) instead of chaining throughown_positionComponent children get a parent link from
own_positionto theirchild_slot, so independent re-renders automatically keep the slot in syncChecklist