flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.71k stars 27.36k forks source link

Document the performance impact of Material widget #15470

Open xster opened 6 years ago

xster commented 6 years ago

Point out that likely only one Material instance per elevation is needed to provide the splash for all of its descendent ink wells. Use DecoratedBox if using just for background colors.

liyuqian commented 6 years ago

The Material gets much faster as we removed the saveLayer call in https://github.com/flutter/engine/pull/5420 and https://github.com/flutter/flutter/pull/18616 . It's probably still slower than DecoratedBox because Material still has shadows and round rects. But without saveLayer, Material is not too much slower, and probably will not be a bottleneck by itself.

xster commented 6 years ago

SG. Can we quantify this?

liyuqian commented 6 years ago

Yes, I'm planning to use @InMatrix 's sample app and our new Clip enum to illustrate the difference in the GDD talk. I'm currently working on finalizing the Clip enum change: https://github.com/flutter/flutter/pull/20205

kf6gpe commented 4 years ago

Looks like the PR @liyuqian mentions has merged; I'm going to assume that this is essentially fixed and close it. Feel free to reopen if I'm wrong, please, @xster and @liyuqian!