-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Measure invalidation performance and fixes (batching version) #24823
Closed
albyrock87
wants to merge
18
commits into
dotnet:main
from
albyrock87:improve-measure-invalidation-with-batch-measure-invalidation
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d2d6864
Improve measure invalidation and legacy Layout(s) performance
albyrock87 706eec8
Add a UI test to log rendering performance
albyrock87 7491dfa
Remove `ApplyBindings` and reduce `OnChildMeasureInvalidatedInternal`…
albyrock87 00138ad
Update Issue24532.xaml.cs
PureWeen a355ff9
Account for view `Constraint` and propagate `InvalidationTrigger` on …
albyrock87 28c806d
Now that we are not invalidating manually each `LegacyLayout`, we hav…
albyrock87 9352b1d
Sync behavior on Page
albyrock87 aafcdf7
Removes old perf test
albyrock87 4bb7d77
Adds a rendering performance test
albyrock87 201e52c
Additional refactor
albyrock87 af89144
Removes performance test
albyrock87 3daf40f
Remove old comments
albyrock87 21b2607
Remove useless branches and fix order of invocation
albyrock87 c124862
Fix broken device test
albyrock87 bc44d29
Third tentative to make things right
albyrock87 81032ba
Cleanup and fix enhanced `ViewTests` broken device test
albyrock87 49f5afe
Batch measure invalidation on binding context changed
albyrock87 4c07e48
Fix rebase errors
albyrock87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
43 changes: 43 additions & 0 deletions
43
src/Controls/src/Core/Internals/InvalidationTriggerFlags.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
|
||
namespace Microsoft.Maui.Controls.Internals; | ||
|
||
[Flags] | ||
internal enum InvalidationTriggerFlags : ushort | ||
{ | ||
None = 0, | ||
ApplyingBindingContext = 1 << 0, | ||
WillNotifyParentMeasureInvalidated = 1 << 1, | ||
WillTriggerHorizontalOptionsChanged = 1 << 2, | ||
WillTriggerVerticalOptionsChanged = 1 << 3, | ||
WillTriggerMarginChanged = 1 << 4, | ||
WillTriggerSizeRequestChanged = 1 << 5, | ||
WillTriggerMeasureChanged = 1 << 6, | ||
WillTriggerRendererReady = 1 << 7, | ||
WillTriggerUndefined = 1 << 8, | ||
} | ||
|
||
internal static class InvalidationTriggerFlagsExtensions { | ||
public static InvalidationTriggerFlags ToInvalidationTriggerFlags(this InvalidationTrigger trigger) { | ||
return trigger switch { | ||
InvalidationTrigger.MeasureChanged => InvalidationTriggerFlags.WillTriggerMeasureChanged, | ||
InvalidationTrigger.HorizontalOptionsChanged => InvalidationTriggerFlags.WillTriggerHorizontalOptionsChanged, | ||
InvalidationTrigger.VerticalOptionsChanged => InvalidationTriggerFlags.WillTriggerVerticalOptionsChanged, | ||
InvalidationTrigger.SizeRequestChanged => InvalidationTriggerFlags.WillTriggerSizeRequestChanged, | ||
InvalidationTrigger.RendererReady => InvalidationTriggerFlags.WillTriggerRendererReady, | ||
InvalidationTrigger.MarginChanged => InvalidationTriggerFlags.WillTriggerMarginChanged, | ||
_ => InvalidationTriggerFlags.WillTriggerUndefined, | ||
}; | ||
} | ||
|
||
public static InvalidationTrigger ToInvalidationTrigger(this InvalidationTriggerFlags flags) { | ||
if ((flags & InvalidationTriggerFlags.WillTriggerUndefined) != 0) return InvalidationTrigger.Undefined; | ||
if ((flags & InvalidationTriggerFlags.WillTriggerRendererReady) != 0) return InvalidationTrigger.RendererReady; | ||
if ((flags & InvalidationTriggerFlags.WillTriggerMeasureChanged) != 0) return InvalidationTrigger.MeasureChanged; | ||
if ((flags & InvalidationTriggerFlags.WillTriggerSizeRequestChanged) != 0) return InvalidationTrigger.SizeRequestChanged; | ||
if ((flags & InvalidationTriggerFlags.WillTriggerMarginChanged) != 0) return InvalidationTrigger.MarginChanged; | ||
if ((flags & InvalidationTriggerFlags.WillTriggerVerticalOptionsChanged) != 0) return InvalidationTrigger.VerticalOptionsChanged; | ||
if ((flags & InvalidationTriggerFlags.WillTriggerHorizontalOptionsChanged) != 0) return InvalidationTrigger.HorizontalOptionsChanged; | ||
return InvalidationTrigger.Undefined; | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidationTrigger
is a public API but at the same time it saysSo I wonder if I could simply change that to: