Merged
Conversation
gfoidl
reviewed
Jan 19, 2021
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs
Outdated
Show resolved
Hide resolved
lindexi
reviewed
Jan 20, 2021
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs
Outdated
Show resolved
Hide resolved
eb3d5f8 to
c1db5ee
Compare
lindexi
approved these changes
Jun 7, 2022
dipeshmsft
approved these changes
Jun 23, 2022
Member
|
This PR will be taken in the next community test pass. |
bgrainger
pushed a commit
to Faithlife/wpf
that referenced
this pull request
Jul 22, 2022
(cherry picked from commit 93c7f4b) Conflicts: src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The method
VerifyAccessis not being inlined because of the Exception. Not inlining the throw is enough to inlineVerifyAccessbecause the methodCheckAccessalready qualifies to be inlined.I used the following code to benchmark it :
https://gist.github.com/ThomasGoulet73/3dbc0cf5d24ca06b639ba6888c27fe02
Here are the results :
The perf gain is small but since
VerifyAccessis used in a lot of place, any perf gain is good.In the future, we could create a ThrowHelper like in the runtime repo. To prevent inlining throws which may prevent methods to otherwise be inlined.