flutter-wonderous-app
flutter-wonderous-app copied to clipboard
Reduce Widget rebuilds on WonderEditorialScreen
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.
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.
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.
If the raster improvement holds up after more precise measurement that is a a pretty big improvement.