Skip to content
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

Visual state perf #1008

Merged
merged 1 commit into from Jun 4, 2019
Merged

Visual state perf #1008

merged 1 commit into from Jun 4, 2019

Conversation

dr1rrb
Copy link
Member

@dr1rrb dr1rrb commented Jun 3, 2019

  • do not re-apply same visual state on each windows size changed
  • clear only setters that won't be updated by the target visual state

PR Type

What kind of change does this PR introduce?

  • Other: Perf optimisations

What is the current behavior?

  • Each time the window is resized, the state triggers are re-evaluated and the target state is re-applied no matter if it has changed or not
  • When we go from a state to another state, we clear the value of all Setters of the current state before applying the Setters of the target state

What is the new behavior?

  • We do not re-apply the VisualState if it's already the current one
  • We clear only Setters that won't be affected by the target state.

PR Checklist

Other information

This is part of a bigger changes set that will add Unit test for this feature

Internal Issue (If applicable):
https://nventive.visualstudio.com/_workitems/edit/154623

Copy link
Member

@jeromelaban jeromelaban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to add a test with something similar to https://github.com/nventive/Uno/blob/086865bc298818a894c050d11638fd25ec5bd1db/src/Uno.UI.Tests/Windows_UI_Xaml_Controls/xLoad/Given_xLoadSetters.cs#L17.

by testing the changes in the DP callback.

src/Uno.UI/UI/Xaml/VisualStateGroup.cs Show resolved Hide resolved
src/Uno.UI/UI/Xaml/Setter.cs Outdated Show resolved Hide resolved
@dr1rrb dr1rrb force-pushed the dev/dr/SettersDiff branch 3 times, most recently from eae312e to 9a0f26b Compare June 4, 2019 19:14
- do not re-apply same visual state on each windows size changed
- clear only setters that won't  be updated by the target visual state
@dr1rrb dr1rrb merged commit 9ae46aa into master Jun 4, 2019
@dr1rrb dr1rrb deleted the dev/dr/SettersDiff branch June 4, 2019 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants