-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove all ElementUtil allocations and stop boxing in DispatcherOperation #10903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
h3xds1nz
wants to merge
54
commits into
dotnet:main
Choose a base branch
from
h3xds1nz:dispatcher-stuff
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…usings (GridItem)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10903 +/- ##
===================================================
- Coverage 13.48885% 2.99275% -10.49610%
===================================================
Files 3317 3338 +21
Lines 664749 664807 +58
Branches 74643 74729 +86
===================================================
- Hits 89667 19896 -69771
- Misses 572488 644726 +72238
+ Partials 2594 185 -2409
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Community Contribution
A label for all community Contributions
PR
metadata: Label to tag PRs, to facilitate with triage
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10679, currently blocked by #10680.
Description
This is a bigger PR, however the impact is proportional to the size of it.
ElementUtil
ofDispatcherOperationCallback
.ElementProxy
.TResult
when the invocation is not on the same thread / Send priority inDispatcherOperation
.Send
priority but the rest was using the objectResult
.Dispatcher
/ElementUtil
.ValueProviderWrapper
/ToggleProviderWrapper
/RangeValueProviderWrapper
/ExpandCollapseProviderWrapper
/TransformProviderWrapper
that test for both wrapper construction and invocations.To further reduce the code complexity between legacy/async invocations, the different flavours of
DispatcherOperation
only contain the respective code-paths that are required, e.g. the non-legacy paths no longer contain wrapped invokes that would never be invoked (as_useAsyncSemantics
would be true).DispatcherOperation
abstract
and removing theprotected virtual
member is not a breaking change as there's no public/protected constructor and thus nobody could have subclassed it or used the method call via regular means.Overall, this will now cause inlining on all the regular hot paths in
ElementProxy
in tier1, further speeding up most of the synchronous/same-thread invocations (which is often the case).There's one thing to consider:
ElementUtil
inner operation won't complete (when the result would haveHasCompleted
set tofalse
) is when aCancellationToken
would be used - which is never, making this essentially a dead code. But I'm keeping it as-is.Customer Impact
See #10679 for impact of this change. In the demo app (which is a repro from this repo), it reduces the total allocation in half and reduces the time required (big part is due to allocations, some due to inlining etc.) to complete by 30% on average.
The unit tests here will also help verify changes in #10237.
Regression
No.
Testing
Local build, new unit tests, testing with regular apps and UIA invocations.
Risk
Medium, the changes are quite broad yet simple. I've included numerous tests to ensure functionality.
Microsoft Reviewers: Open in CodeFlow