You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I was using BitmapPool until 1.x.x version. However in 2.x.x version BitmapPool is removed. Can someone explain why it was removed and what are the alternatives
BitmapPool and PoolableViewTarget have been removed from the library in 2.x. Bitmap pooling was removed because:
It's most effective on <= API 23 and has become less effective with newer Android releases.
Removing bitmap pooling allows Coil to use immutable bitmaps, which have performance benefits.
There's runtime overhead to manage the bitmap pool.
Bitmap pooling creates design restrictions on Coil's API as it requires tracking if a bitmap is eligible for pooling. Removing bitmap pooling allows Coil to expose the result Drawable in more places (e.g. Listener, Disposable). Additionally, this means Coil doesn't have to clear ImageViews, which has can cause issues.
Bitmap pooling is error-prone. Allocating a new bitmap is much safer than attempting to re-use a bitmap that could still be in use.
Also Android's ImageDecoder (which is supposed to replace BitmapFactory) intentionally doesn't support bitmap pooling due to the above reasons.
If you need BitmapPool you can copy the implementation into your project.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So, I was using BitmapPool until 1.x.x version. However in 2.x.x version BitmapPool is removed. Can someone explain why it was removed and what are the alternatives
Beta Was this translation helpful? Give feedback.
All reactions