Repository navigation
docs(perf): Add the measured performance evidence - #24238
Conversation
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Pull request overview
Adds a new internal engineering evidence document capturing measured before/after performance data and validation notes for the ongoing Uno Platform performance-improvement work.
Changes:
- Adds
specs/059-performance-improvements/evidence.mddocumenting the measurement harnesses, baseline numbers, and per-fix before/after results. - Records correctness validation methodology (filtered runtime-test suites, set-comparison of failures) and known validation limitations.
- Documents investigated-but-rejected optimizations and pre-existing runtime-test failures/crash constraints for future maintainers.
Suppressed comments (2)
specs/059-performance-improvements/evidence.md:74
- The micro-benchmarks section name includes a machine-specific path. Consider using the same
<local-path>placeholder for consistency with the other harness descriptions.
### 2.3 Micro-benchmarks — `D:\Throwaway\uno-perf-bench`
specs/059-performance-improvements/evidence.md:63
- The allocation-profiler section also hard-codes local D:\Throwaway\ paths. Using the same
<local-path>placeholder keeps the instructions copy/pasteable across machines.
### 2.2 Allocation profiler — `D:\Throwaway\uno-perf-analyzer`
`dotnet-trace` + a TraceEvent-based analyzer that attributes sampled allocations **by type and by
call stack**, which is how each finding below was located rather than guessed:
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24238/docs/index.html |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24238/docs/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24238/docs/index.html |
a09ece8 to
5a01289
Compare
|
Claude finished @MartinZikmund's task in 3m 17s —— View job Review complete ✅
Verdict: ship (1 nit)This is a docs-only change (no code, The three items flagged in the earlier Copilot review round have all been addressed in the current revision:
New finding (posted inline): one stale source-line citation — No other correctness, structural, or scope concerns — the document is unusually rigorous for an evidence log (it documents its own correction transparently in F2, distinguishes measured vs. reasoned numbers throughout, and is honest about validation limits in §5.5). |
There was a problem hiding this comment.
🟡 Changes recommended
The new documentation includes a broken inline code identifier (split across lines with a non-ASCII hyphen) and a shell-specific command block that should be clarified for Windows reproducibility.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
| dotnet build src/SamplesApp/SamplesApp.Skia.Generic/SamplesApp.Skia.Generic.csproj \ | ||
| -c Release -f net10.0 -p:UnoFastDevBuild=true -p:UnoTargetFrameworkOverride=net10.0 | ||
| export UITEST_RUNTIME_TESTS_FILTER=$(echo -n "<filter>" | base64) | ||
| cd src/SamplesApp/SamplesApp.Skia.Generic/bin/Release/net10.0 | ||
| dotnet SamplesApp.Skia.Generic.dll --runtime-tests=test-results.xml |
| `ResourceResolver.TryVisualTreeRetrieval` was rewritten from `(x as DependencyObject)?.GetResource‑ | ||
| Dictionaries(true)` + null check to `if (scope?.Target is DependencyObject owner)`, so the struct is | ||
| enumerated directly rather than through a nullable. |
| property type is `bool`, and pass `value` through unchanged for every other type. This is automatic | ||
| for any `bool` DP added later. | ||
|
|
||
| **Why it cannot change behaviour.** `DependencyObject.AreDifferent` (`DependencyObject.Store.cs:2313`) |
There was a problem hiding this comment.
Line-number citation is off: DependencyObject.AreDifferent is actually at DependencyObject.Store.cs:2192 in the current tree, not :2313.
internal static bool AreDifferent(object? previousValue, object? newValue)
{
if (newValue is ValueType || newValue is string)
{
return !object.Equals(previousValue, newValue);
}
...The described behavior (value comparison via the ValueType branch) is correct — only the line number is stale. Worth double-checking since this doc's value rests on citations being exact and independently verifiable (I spot-checked ~10 other citations in this file — StackVector.cs:49/62, MaterializableList.cs:109/127-135/144, InsetClip.skia.cs:24-31, CompositionGeometricClip.skia.cs:31, BorderVisual.skia.cs:204/310 — and all of those were exact, so this looks like an isolated slip rather than a pattern).
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24238/docs/index.html |
morning4coffe-dev
left a comment
There was a problem hiding this comment.
The measured-versus-estimated distinctions, corrected warm-up comparison and explicit validation limits are useful. The remaining blocker is reproducibility/provenance: the commands require three unprovided external harness projects, while the source states are generally identified only by commit subjects or 'the merge-base of this branch'. This PR is now documentation-only, so that moving branch reference does not identify the historical measured trees. Please provide public harness/artifact locations and immutable before/after source IDs, or explicitly present the figures as historical author-reported results rather than claiming the listed commands reproduce them.
| ## 2. Harnesses | ||
|
|
||
| The three harnesses below live outside the repo (they reference it) so they never ship. They are | ||
| reproducible from the commands below, run from a local scratch directory referred to as |
There was a problem hiding this comment.
[P2] These commands cannot reproduce the measurements from a clean checkout: uno-perf-int, uno-perf-analyzer and uno-perf-bench are not included or linked, and cd/build does not create those projects. The baseline and per-fix sections also need immutable source revisions, not only commit subjects/current merge-base. Please add public reproducible harness inputs plus before/after SHAs (and preferably raw result artifacts), or qualify the text as historical author-reported evidence with the reproducibility limitation stated explicitly.
Records the methodology, the harnesses, and one section per fix with its before/after numbers, control workloads and runtime-test comparison -- including the measurement that had to be corrected, the optimisations that were tried and rejected, and the validation limits. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015DSdL5YzLhjx8CeGXZf1Au
Adds the section for the generated bool DP setters (72 B -> 48 B per set, exactly one box), and records two subsystems profiled for the first time that did not yield a fix -- pointer input and template materialisation -- with their numbers and why each is spread rather than hot-spotted. Also records what stops the work being repeated: the apparent lock contention on the pointer path is workload setup rather than routing, and Enum.HasFlag allocates nothing on .NET 10 (measured), so the 172-site sweep it appeared to justify is not worth doing. Finally notes the 151 hand-written bool DP setters the generator fix does not cover. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015DSdL5YzLhjx8CeGXZf1Au
Fix the harness-count wording ("both" -> "three"), drop the
stale personal branch reference, and replace hard-coded
D:\Throwaway paths with a <local-path> placeholder so the
commands are copy/pasteable on any machine.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0135NCgAaTksniZ1pUUzAGuE
5a01289 to
6c1920f
Compare
|
Claude finished @MartinZikmund's task in 3m 51s —— View job Review complete ✅
Verdict: ship (3 nits, all previously-flagged-but-unaddressed)This is a docs-only change, so the AGENTS.md rule that actually applies is "Public Documentation and Spec References." It's satisfied: all issue links ( The branch/path/wording items from the 2026-08-27 Copilot round are confirmed fixed in commit Three items remain open from the 2026-09-10 review round (same commit
Cross-cutting observation: I checked a further sample of this document's line-number citations against the current tree ( No correctness, structural, or scope concerns beyond the three nits above — the document remains unusually rigorous for an evidence log (transparent self-correction in F2, clear measured-vs-reasoned labeling throughout, honest validation-limit disclosure in §5.5). |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Reconcile inconsistent test totals and correct implementation, command, and accounting descriptions.
Review effort: Lite
Findings: 10
Open (10)
Test-count convention is inconsistent across sections · New Explanation cites nonexistent property-change override · New Suite total is off by one · New Explanation references APIs and comparison methods absent from code · New F5 correctness count is off by one · New Suite total is inconsistent with pass and failure counts · New L1 outcome total does not match results · New Generated helper name does not match emitted code · New The identifierGetResourceDictionariesis split across two lines with a non-ASCII hyphen inside… The runtime-test filter example usesexport ... | base64, which is bash-specific, but the…
| **363 run, 358 passed, 7 skipped, 5 failed.** All 5 failures reproduce **unchanged on the baseline** | ||
| with the fix stashed (verified by rebuilding and re-running them), so none is caused by this change: |
| **Fix.** Build the path once and keep it. The path depends **only on this clip's own properties** — | ||
| `RectangleClip.GetBoundsCore` reads `Left`/`Top`/`Right`/`Bottom` and ignores the `visual` argument, | ||
| and `GetBounds` then applies the clip's own `TransformMatrix` — so an override of | ||
| `OnPropertyChangedCore` drops the cached path whenever any property changes. That makes the hot path | ||
| a single null check, which is *less* work than before, not a trade. |
| `Given_Visual_Damage`, `Given_UIElement`, `Windows_UI_Xaml_Shapes.*`): **671 run, 654 passed, | ||
| 16 failed**, compared as sets against the F3 run — **0 new failures, 0 newly passing.** |
| **Fix.** Cache the path, keyed on the `SKRoundRect` instance it was built from. | ||
| `CreateBorderPath` assigns a **brand new** `SKRoundRect` to `_borderPathOuterRect` every time it | ||
| runs (`BorderVisual.skia.cs:362-363`: `var outerRect = new SKRoundRect(); … _borderPathOuterRect = outerRect;`), | ||
| so `ReferenceEquals` is an exact cache key — a changed border geometry always produces a new | ||
| instance and therefore a cache miss. The superseded path is disposed, keeping the deterministic | ||
| native cleanup the old `using` provided. | ||
|
|
||
| The returned path never escapes: `GetPrePaintingClipping` either intersects it into `dst` or | ||
| transforms it into `dst`, both within the same call. |
| **Correctness.** Same suite as F3/F4: **671 run, 654 passed, 16 failed**, set-compared against the | ||
| F4 run — **0 new failures, 0 newly passing.** |
| **937 run, 911 passed, 6 skipped, 25 failed**, set-compared against the baseline — | ||
| **0 new failures, 0 newly passing.** |
| `Given_XBind_NavigatedTo`, `Given_FrameworkElement_And_Leak`, `Given_ListViewBase`: **278 run, 270 | ||
| passed, 11 skipped, 7 failed**, set-compared against a baseline build — **0 new failures, 0 newly |
| **Fix.** Both generators now emit `SetValue(XProperty, Uno.UI.Helpers.Boxes.Box(value))` when the | ||
| property type is `bool`, and pass `value` through unchanged for every other type. This is automatic | ||
| for any `bool` DP added later. |
| property type is `bool`, and pass `value` through unchanged for every other type. This is automatic | ||
| for any `bool` DP added later. | ||
|
|
||
| **Why it cannot change behaviour.** `DependencyObject.AreDifferent` (`DependencyObject.Store.cs:2313`) |
There was a problem hiding this comment.
This citation is still stale, and has drifted further since it was first flagged. DependencyObject.AreDifferent is now at DependencyObject.Store.cs:2181 (it was :2192 when this was flagged on 2026-09-10, and the doc still says :2313). The described behavior (the ValueType/object.Equals branch) is still correct — only the line number is wrong.
Given the doc's premise rests on every citation being independently verifiable, and this is the second time around without a fix, it may be worth dropping the :NNNN suffix for citations like this one that state a timeless invariant (vs. a point-in-time measurement) — a bare DependencyObject.Store.cs reference to the method name doesn't go stale the way a line number does.
| `ResourceResolver.TryVisualTreeRetrieval` was rewritten from `(x as DependencyObject)?.GetResource‑ | ||
| Dictionaries(true)` + null check to `if (scope?.Target is DependencyObject owner)`, so the struct is |
There was a problem hiding this comment.
The inline-code span for GetResourceDictionaries is still broken across the line wrap: it ends the line with a non-ASCII hyphen (U+2011) instead of closing the backtick, so the span `(x as DependencyObject)?.GetResource‑ never closes until mid-word on the next line (`Dictionaries(true)```). This was flagged by a reviewer on 2026-09-10 ("won't copy/paste as valid C#") but is still present verbatim in this revision. Rejoining the identifier onto one line (or using a fenced code block) would fix both the broken span and the stray U+2011 character.
| ```bash | ||
| dotnet build src/SamplesApp/SamplesApp.Skia.Generic/SamplesApp.Skia.Generic.csproj \ | ||
| -c Release -f net10.0 -p:UnoFastDevBuild=true -p:UnoTargetFrameworkOverride=net10.0 | ||
| export UITEST_RUNTIME_TESTS_FILTER=$(echo -n "<filter>" | base64) |
There was a problem hiding this comment.
Nit (previously flagged, not yet addressed): export ... | base64 is bash syntax, but §3's baseline is Windows 11. A one-line note that this block assumes bash/WSL/Git Bash (or a PowerShell equivalent, e.g. [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("<filter>"))) would make it reproducible without translation for a Windows-only reader.
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24238/docs/index.html |

GitHub Issue: n/a — documentation only
PR Type:
📚 Documentation content changes
What changed? 🚀
Adds
specs/059-performance-improvements/evidence.md, the measured evidence behind the performanceseries in this batch of PRs. It records:
Uno.UI,Uno.UI.Composition,Uno.WinRT,Uno.FoundationandUno.UI.Dispatchingso every measurement runs the code beingchanged; and a
dotnet-trace+ TraceEvent analyzer that attributes allocations by type and callstack, which is how each finding was located rather than guessed.
and the runtime-test comparison done as sets of failing test names against a baseline build.
(the two runs used different workload sets, so JIT warm-up differed) and the corrected figure is
−15.3 %. The correction and its cause are recorded rather than quietly edited.
invalidation sources bypass the funnel, one of which is a live bug), the
DependencyPropertydetail pools that are rarely returned, an optimisation that measured well but was reverted for
diverging from WinUI, and micro-optimisations rejected for having no measurable win.
SKSurfacefinaliser, and the pre-fix tree crashes identically, so validation rests on filteredsuites of up to 937 tests rather than a whole-suite run.
PR Checklist ✅
Screenshots Compare Test Runresults. — n/a, no code change