georstat / react-native-image-cache

React-Native image caching in file system with progressive loading for iOS and Android
MIT License
381 stars 31 forks source link

Slow performance #74

Open Stas-Buzunko opened 9 months ago

Stas-Buzunko commented 9 months ago

Used react-native-image-cache ^3.1.0. These are the milliseconds it takes to read from the cache for 6 profile pictures, each around 50KB:

LOG onLoad 298
LOG onLoad 304
LOG onLoad 328
LOG onLoad 318
LOG onLoad 320
LOG onLoad 314
Average 313ms

And here are the same 6 profile pictures using the default Image once they are loaded:

LOG onLoad 187
LOG onLoad 174
LOG onLoad 162
LOG onLoad 151
LOG onLoad 138
LOG onLoad 129
Average 156.83ms

Additionally, there is some time until the default loading animation is replaced with the image, making the whole experience feel slow. I initially thought caching didn't work at all and spent more than an hour debugging. It feels 3-4 times slower than using the default Image once the source is loaded.

efstathiosntonas commented 9 months ago

Hi @Stas-Buzunko, sorry for the late reply, it’s been a tough month. Have you tried decreasking the animation duration? Slowness is kinda normal since we load 2 image components, both animated, one for thumb and one for the actual image.

Tomorrow I’ll create a new version that totally removes the thumbnail image component from the render tree as it stays there behind the actual image (not a bug but bad flow since it consumes resources and it’s not visible).

francois-pasquier commented 8 months ago

Hey great lib, any news about the new version?