You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Calling PropertyValue.Create to handle boxing is significantly slower than allocating an IReference directly #1416
WPF users are expecting WinUI 3 to match WPF performance - and setting 200k DPs takes 21ms with WPF, but 130ms with WinUI 3. We ought to try and match that speed where possible, and this should help by cutting middlemans, at least in C++.
Reacted by rtanabe999, Jaiganesh Kumaran and brabebhin
As I recall, the PropertyValue implementations offer marshal-by-value semantics which the C++/WinRT fallback does not. This is/was required for some APIs depending on boxing. We can't change this now without the risk of breaking such callers. In practice, it's mostly only interesting to Xaml but there are other APIs that depend on this.
I'm concerned that there may be projections that rely on boxed values supporting IPropertyValue.
This must already be implemented since it is required by IReference<T>. Of course, the implementation may be different... Another question is whether the marshaling behavior will change and cause issues.
Activity
jgkumaran commentedon May 15, 2024
Reälly reminds me of those StructHelper types, which offered often basic functionality, doäble by yourself, with much greater overhead.
I approve replacing PropertyValue.Create* methods! That said, can we finally get useful interfaces like IStringable implemented on boxed objects?
kennykerr commentedon May 16, 2024
As I recall, the
PropertyValueimplementations offer marshal-by-value semantics which the C++/WinRT fallback does not. This is/was required for some APIs depending on boxing. We can't change this now without the risk of breaking such callers. In practice, it's mostly only interesting to Xaml but there are other APIs that depend on this.jgkumaran commentedon May 16, 2024
Kenny Kerr (@kennykerr) Can't we implement this ourselves?
sylveon commentedon May 16, 2024
From a cursory search, CsWinRT seems to allocate its own IReference (which works fine with XAML).
github-actions commentedon May 27, 2024
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.
oldnewthing commentedon Nov 30, 2025
I'm concerned that there may be projections that rely on boxed values supporting IPropertyValue.
sylveon commentedon Nov 30, 2025
Could we have winrt::impl::reference implement that? I wonder if CsWinRT implements it for theirs.
kennykerr commentedon Dec 1, 2025
This must already be implemented since it is required by
IReference<T>. Of course, the implementation may be different... Another question is whether the marshaling behavior will change and cause issues.