为什么使用Glide从Firebase Store加载图像的速度这么慢?

时间:2019-01-22 02:08:32

标签: android firebase-storage android-glide

我从Firebase商店使用Glide预加载了一些图像,其中40张图像的大小在5kb-30kb之间,尺寸为180x256-480x640px ..

                 `for(int i = 0;i<40;i++){

                              ref= storageRef
                               .child("ItemsSlike")
                               .child(array.getItem(i).getKey())
                               .child("tile.webp");


                                    glide
                                   .load(ref)
                                   .diskCacheStrategy(DiskCacheStrategy.ALL)
                                   .centerCrop()
                                   .priority(Priority.LOW)
                                   .dontAnimate()
                                   .listener(new RequestListener<Drawable>() {
                                            @Override
                                            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                                                return false;
                                            }

                                            @Override
                                            public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                                                Log.i("nhy","preload:  "+resource);
                                                return false;
                                            }
                                        })
                                        .signature(new 
            ObjectKey(((Item)array.getItem(i).getValue()).getVremeDodato()))
                                        .preload(photo,photo);
}`

需要10秒钟以上吗?!

01-22 02:30:17.949 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@aca5fbb
01-22 02:30:18.054 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@6f7ecd8
01-22 02:30:18.113 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:   
01-22 02:30:18.785 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@4b62b16
01-22 02:30:18.801 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@bb53c97
01-22 02:30:18.886 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@86afe84
01-22 02:30:19.443 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@d32c66d
01-22 02:30:19.444 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@c61e2a2
01-22 02:30:19.469 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@4070b33
01-22 02:30:20.321 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@8db7ef0
01-22 02:30:20.322 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@3c25c69
01-22 02:30:20.323 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@41f86ee
01-22 02:30:20.866 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@69d278f
01-22 02:30:20.927 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@a919a1c
01-22 02:30:21.245 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@e0123fa
01-22 02:30:21.365 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@cceadab
01-22 02:30:21.387 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@a2c3c08
01-22 02:30:22.195 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@5502fa1
01-22 02:30:22.196 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@92d85c6
01-22 02:30:22.209 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@4487987
01-22 02:30:23.439 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@48420
01-22 02:30:24.027 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@2ee31d9
01-22 02:30:24.027 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@971879e
01-22 02:30:24.076 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@edd127f
01-22 02:30:24.634 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@cfdc24c
01-22 02:30:24.696 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@c071295
01-22 02:30:24.714 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@aea7faa
01-22 02:30:25.255 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@3a579b
01-22 02:30:25.258 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@c6ab738
01-22 02:30:25.326 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
01-22 02:30:25.876 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@f48ec76
01-22 02:30:25.886 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@35cd277
01-22 02:30:25.920 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@5b00ee4
01-22 02:30:26.486 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@8d7ff4d
01-22 02:30:26.501 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@64f5a02
01-22 02:30:26.517 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@cc21f13
01-22 02:30:27.097 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@fd13550
01-22 02:30:27.110 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@6324349
01-22 02:30:27.143 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@75d144e
01-22 02:30:27.724 8472-8472/com.packtpub.materialdesign4 I/nhy: preload:  
android.graphics.drawable.BitmapDrawable@125996f

这是否真的是最快的?如何更快地预加载图像,例如在Pinterest和其他类似的应用程序上...我在开始时预加载40张图像,然后在滚动时每20个项目就预加载20个新项目,而当我滚动得更快时,新项目就不会预加载到达预加载状态。如何加速所有速度?

0 个答案:

没有答案