Repository navigation
View hierarchy: fewer allocations per node in the walk and the writer - #30
Conversation
One transform matrix per element depth is reused by every node at that depth instead of a clone per node (a node's matrix is only read while its own subtree is visited, and everything below it is at a greater depth). Child and overlay lists are created only when used. The options object is written without a temporary list, and the template is not joined just to read its length. The payload is byte for byte the same on five trees (Material screen, options, overlay, eager list, node cap) against the previous builder. Profile build on devices, one run each: a lazy list 8.7-9.0 to 6.9-7.5 ms on the Android phone, an eager 1000-row list 30.2 to 25.8 ms, the iPhone XS 4-7% faster. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxNbNUdWru1zs68bYV8 Change-Id: I6a27fc87856754ea4617dc41aa3984d1b722ef76
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
No actionable comments were generated in the recent review. Summary
Change: Refactor Merge Risk:
|
|
Claude finished @krassx's task in 36s —— View job Review of #30: fewer allocations per node in the walk and the writerI found no real issues. I read the diff against the surrounding code in Overall risk: Low What I checked
Optional follow-up (P3, not blocking)The "same payload" evidence is five trees compared against the old builder. That comparison cannot be repeated once this lands, and I did not find a test aimed at the aliasing invariant itself. A cheap guard would be a golden payload for a deeply nested tree that mixes Positives
|
…chy-alloc-trim Change-Id: I44d288ba960a1e64c47bba72f563f0c92b2623f1 # Conflicts: # PLAN.md # doc/view-hierarchy.md
|
Claude finished @krassx's task in 26s —— View job Review of #30: fewer allocations per node in the walk and the writer (re-run on push)I found no real issues, and nothing new compared with my earlier review. The only change since then is the merge of the base branch ( Overall risk: Low Re-checked this round
Optional follow-up (P3, not blocking, same as before)The "byte for byte identical" evidence comes from a one-off comparison against the old builder, and I found no test aimed at the depth-aliasing invariant itself. A golden payload for one tree that mixes Positives
|
…' into perf/view-hierarchy-alloc-trim Change-Id: Ieee271d90d6134140d2f3bdea02dad7ab2af6be4
|
Claude finished @krassx's task in 23s —— View job Review of #30: fewer allocations per node in the walk and the writer (re-run on push)I found no real issues, and nothing new compared with my two earlier reviews. The only change since the last review is a merge of the base branch ( Overall risk: Low Re-checked this round
Optional follow-up (P3, not blocking, same as before)The "byte for byte identical" evidence is a one-off comparison against the old builder, and I found no test aimed at the depth-aliasing invariant. A golden payload for one tree that mixes Summary
|
…chy-alloc-trim Change-Id: I04a9476b557f2b5cc7d9d0c8b230f6051599139a
|
Claude finished @krassx's task in 24s —— View job Review of #30: fewer allocations per node in the walk and the writer (re-run on push)I found no real issues, and nothing new compared with my three earlier reviews. The only change since the last review is a merge of the base branch ( Overall risk: Low Re-checked this round
Optional follow-up (P3, not blocking, same as before)The "byte for byte identical" evidence is a one-off comparison against the old builder, and I found no test aimed at the depth-aliasing invariant. A golden payload for one tree that mixes Summary
|
Stacked on #29.
clone()per node. Safe because a node's matrix is read only while its own subtree is visited, and everything below a node is visited at a greater depth than the node (a provider of data does not add a level, but the render node below it is still deeper than the render ancestor whose matrix it reads);optionsobject written without a temporary list;Same output: the payload (
render()), node count, bounds and truncation are byte for byte identical to the previous builder on five trees (Material screen with tabs and 40 cards, options such as opacity/secure/clickable/image/rotate, anOverlayPortal, a 300-row eager list, a node-capped list); the existing builder tests, including the differential tests of #26, pass.Measured (profile build, median of 25, unlimited limits, one run each on the same day, before then after):
Run-to-run noise on the same code is about ±5%, so the iPhone gains and the 3000-row case are within noise; the Android lazy and 1000-row gains are not. The research agent measured 0-5% on an emulator, the phone gains more.
Checks:
flutter analyze, fullflutter test.🤖 Generated with Claude Code