Repository navigation
perf: Size DependencyProperty storage to the properties set - #25047
Conversation
|
Claude finished @MartinZikmund's task in 18s —— View job Review of #25047Verdict: ship, pending CI runtime tests. Issues: 0 high, 0 medium, 1 low (inline). Summary
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25047/wasm-skia-net9/index.html |
|
The build 237637 found UI Test snapshots differences: Details
|
|
Claude finished @MartinZikmund's task in 12s —— View job Re-review of #25047 (after
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25047/wasm-skia-net9/index.html |
|
The build 238683 found UI Test snapshots differences: Details
|
|
Claude finished @MartinZikmund's task in 18s —— View job Re-review of #25047 (head
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25047/wasm-skia-net9/index.html |
|
The build 238854 found UI Test snapshots differences: Details
|
|
|
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Verified by inspection at head 1a077d4: the open-addressed table in DependencyPropertyDetailsCollection.cs keeps capacity a power of two with load at or below 50%, so every probe loop terminates. The shared length-1 _noEntries array is never written, because the first Add grows it. Grow re-inserts from the stored UniqueId and leaves the old array intact for walks in progress. No Dispose callers remain in src/Uno.UI at head. The walkers (EnterProperties/LeaveProperties in DependencyObject.PropertySystem.mux.cs, InnerUpdateChildResourceBindings in DependencyObject.Theming.cs) handle null entries. Public surface is unchanged. WinUI parity does not apply: this is internal storage.
I did not build or run anything, so this is code review by inspection only. The allocation and timing numbers are the author's.
Findings, most important first:
-
CI is red at head 1a077d4 (Azure build 238854).
Uno.UI - CI (Tests - Android Skia Runtime Tests 3)fails with "The test results file ... does not contain any results". The retry stage's filter decodes toSamplesApp.Tests.Given_ShellLayout.When_Focus_Mode_Exit_Button_Idles_It_Hides_Until_Activity Cleanup | invalid-test-for-retry. That test does not exist in this tree, so the retry ran nothing. This looks like a stale failure list on the agent, not this change. Please rerun to confirm.PublishTestResultsalso reports test failures in the result files. I could not read the failing test names without Azure auth. Please post them, or confirm they also fail on master. -
Screenshot diffs: build 238854 reports 118 changed on Linux and 2458 of 2486 on Windows. PR #25307 (base master, no storage change) shows the same counts, so this looks like baseline drift on this branch family rather than an effect of this change. Please confirm against a master run before merge.
-
Minor:
When_Borders_Are_Created_Then_Allocation_Stays_Boundedasserts under 3200 bytes pernew Border(). The PR's measured value is 3,032, a margin of about 5%.GC.GetAllocatedBytesForCurrentThreadis sensitive to TFM and build configuration, so this may be flaky on some CI legs. Consider a looser ceiling. -
Minor:
GetAllDetails()now returns the live table in hash order. The doc comment covers the snapshot semantics. I read the three call sites and none obviously depends on sibling order, but I did not trace Enter/Leave side effects. A runtime test that pins Enter/Leave order would make that explicit.
Once #25047 is confirmed green, I would expect to approve it.
DependencyPropertyDetailsCollection rented 16-slot buckets from a LinearArrayPool plus a short[] offsets array indexed by the global UniqueId. Since the DependencyObject disposal path was removed, nothing returns the final arrays, so every element paid a fresh DPD[32] and short[16] for two properties, and the offsets array grew with the property's global id. Replace it with an open-addressed table keyed by UniqueId (linear probing, at most half full, starting at 4 slots), allocated directly. No offsets array, no pool, and a replaced array is never cleared under an in-flight GetAllDetails enumeration. Drop the unreachable Dispose. new Border() 3320 -> 3032 B, Button 5896 -> 5608 B; 7 properties with ids ~3000: 1651 -> 816 B. GetValue hit/miss unchanged within noise. Refs #24754 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
1a077d4 to
e0fe1c7
Compare
|
Claude finished @ajpinedam's task in 18s —— View job Re-review of #25047 (head
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241733 found UI Test snapshots differences: Details
|
GitHub Issue: closes #24754
PR Type:
🐞 Bugfix
What changed? 🚀
DependencyPropertyDetailsCollectionstored property details in 16-slot buckets (plus an offsets array) rented from shared pools. Since the DependencyObject finalizer and disposal path were removed (#23703), an element's final arrays are never returned, so pools only recycle outgrown arrays and every element ends up allocating fresh, mostly empty 16- or 32-slot arrays (~+290 B perBordervs 6.7).This replaces the buckets, the offsets array and both pools with a small open-addressed table keyed by
DependencyProperty.UniqueId. It starts at 4 slots and stays at most half full; lookups stay O(1). The unreachableDisposeis removed. This also removes a latent bug where aGetAllDetails()walk adding a property returned the old array to the pool (cleared, rentable by another element) while it was still being read.Measured, bytes allocated per creation:
BorderGridTextBlockButtonGetValuespeed is unchanged within noise (unset 5.59 → 5.49 ns, set 7.87 → 7.46 ns, alternating builds, best of 5).Tests:
Given_DependencyPropertyDetailsCollection(unit tests): high-id property, freshBorderslot count andnew Border()allocation fail on master and pass now; collision/growth tests added. Full unit suite (4,258) shows no new failures (12When_Gregorian_FixedDate*fail on both builds, timezone-related).Note:
GetAllDetails()iteration order changes (enter/leave and theme walks follow it). Nothing found that depends on the order; CI runtime tests will confirm.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm