ignition icon indicating copy to clipboard operation
ignition copied to clipboard

RemoteImageView's initialize leads to poor performance of RemoteImageGalleryAdapter

Open Steven-Meyer opened this issue 13 years ago • 1 comments

Currently in the initialize of RemoteImageView if "sharedImageLoader" is null then a new instance of RemoteImageLoader is created. This will call "enableDiskCache" which in turn calls "sanatizeDiskCache", which is a costly method.

In the getView of the RemoteImageGalleryAdapter, if convertView is null then a new instance of RemoteImageView is created, which following the flow of the above paragraph will call "sanatizeDiskCache".

This means that"sanatizeDiskCache" will be called frequently when scrolling through a gallery, and will really takes a lot of cpu time and can causes the frame rate to really slow down.

A simple work around is to set a "sharedImageLoader", stopping new instances of "RemoteImageLoader" and preventing the "sanatizeDiskCache" calls. This is an easy step, but one that was not obvious to me when setting up my gallery, and so i would presume that it would not be obvious to others doing the same.

Steven-Meyer avatar May 22 '12 21:05 Steven-Meyer

Good point, thanks for reporting.

mttkay avatar May 23 '12 08:05 mttkay