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

Reduce Widget rebuilds on WonderEditorialScreen #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kenzieschmoll
Copy link
Contributor

Confirmed with the Widget rebuild stats tool in IntelliJ that this reduces unnecessary widget rebuilds. If a widget is completely transparent (opacity 0), there is no value for rebuilding and rendering - only cost. This PR reduces that.

@kenzieschmoll kenzieschmoll marked this pull request as ready for review September 15, 2022 21:25
@jacob314
Copy link

Do you have before and after stats for how this impacts frame render times? Not all rebuilds are bad only ones that lead to Flutter doing a lot of work rebuilding or rendering.

@kenzieschmoll
Copy link
Contributor Author

kenzieschmoll commented Sep 15, 2022

These changes appear to have slightly improved both. This sort of A / B testing in general is a gap in our tooling. I manually hacked this calculation into DevTools and did my best to reproduce a consistent set of frames, but this isn't a great user experience.

before:
Avg Build = 0.7154471544715447
Avg Raster = 6.065040650406504

after:
Avg Build = 0.6283185840707964
Avg Raster = 5.212389380530974

It does "feel" a tad smoother, too. Perhaps theres a bit of a latency decrease between frames that is difficult to measure with our tools.

@jacob314
Copy link

If the raster improvement holds up after more precise measurement that is a a pretty big improvement.

Copy link

@callmephil callmephil left a comment

Choose a reason for hiding this comment

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

.

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.

3 participants