Repository navigation
perf(dp): Cache DependencyProperty lookups by name - #26585
MartinZikmund wants to merge 2 commits into
Conversation
Co-Authored-By: Martin Zikmund <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Co-Authored-By: Martin Zikmund <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
|
Claude finished @MartinZikmund's task in 24s —— View job Review summaryVerdict: ship after the description is reconciled with the diff. I found 1 issue, a minor description/diff mismatch, and no blockers. I reviewed the
Cross-cutting notes
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
| // e.g. ScrollContentPresenter, for which using the Name property should not fail. | ||
| && !isMixinFrameworkElement | ||
| // Evaluate the extra type checks last; validation runs on every property access in DEBUG. | ||
| && !IsMixinFrameworkElement() |
There was a problem hiding this comment.
The PR description says DependencyObjectStore now creates its inherited-property and callback-token maps lazily, but this file's diff only reorders the DEBUG owner validation. _propertyChangedTokens is already ??=-allocated on origin/master, and the diff has no change to the inherited-property map. Please either fix the description or point to where the lazy-allocation change lives. As written, Given_DependencyObject_LazyState may be covering behavior this PR doesn't change.
|
Tick the box to add this pull request to the merge queue (same as
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247320 found UI Test snapshots differences: Details
|
GitHub Issue: Part of #24093
PR Type:
🔄 Refactoring
What changed? 🚀
Split out of #24094 (originally by @morning4coffe-dev), which now only carries the opt-in
XamlOptionalChangespart. This piece is always on, so it gets its own review.Lazy:DependencyObjectStoremapsmasteralready creates them on first use, so after the rebase this PR only reorders the DEBUG-only owner validation in the store.MetadataAPI's DP reflection cache was a deadDictionary. It is now aConcurrentDictionary, because property-path resolution isn't confined to the UI thread. Null results are cached only when the type has no matching member, so a static initializer that hasn't run yet can't poison the entry.RuntimeTypeMetadataUpdateHandler), and entries from secondary ALCs are evicted through the sharedAlcCacheSweep.Validation
Uno.UI.UnitTests(net11.0).Given_DependencyObject_LazyStateandGiven_MetadataAPI_DependencyPropertyCache, 14/14.Performance
Headless Skia app with Fluent resources (x64, net10.0,
DOTNET_TieredCompilation=0), one process per scenario, 4 interleaved A/B rounds againstmaster. Allocations are UI-thread bytes and exact: amaster-vs-masternull run drifted 0.00%. A time change is bold only when it is larger than that scenario's null drift and the A/B ranges don't overlap; anything else is marked noise. Background load on the machine made some timings noisy.Tagset/getBorder+ child (no templates)Buttons, built + laid out{Binding}s (Name,Address.City,Tags[1])MetadataAPI.TryGetDependencyPropertyByName)ComboBox,DisplayMemberPathover DO items, 200 selectionsThe DP-by-name reflection cache works as intended: a lookup goes from 48 B and two reflection calls to a cache hit, 55% faster. Its callers in Uno today are attached-property name resolution and ComboBox
DisplayMemberPathoverDependencyObjectitems, and in the end-to-end ComboBox scenario the saving is lost among everything else a selection does (that row even shows +100 B per selection). The scenario workloads are unchanged, becausemasteralready creates the store's maps lazily (see the note above).PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX