react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Optimize BitmapImage usage

Open kmelmon opened this issue 7 years ago • 1 comments

ImageViewManager re-creates a new BitmapImage every time you change the source. We want it to modify the BitmapImage's source instead.

See ImageViewManager.cpp => ImageViewManager::setSource()

kmelmon avatar Mar 05 '19 01:03 kmelmon

I'm sure you already know that this optimization is worthwhile. But just adding my 2 cents.

We did this in Microsoft Store app by structuring the XAML markup to have a BitmapImage and set the url on that instead of directly on Image. The optimization is definitely worthwhile. I might be able to dig up traces of the gains we saw if you're interested.

stecrain avatar Mar 06 '19 23:03 stecrain