본문 바로가기
📱 Android

[Android] Glide vs Picasso

by 콩드로이드 2024. 3. 17.

이미지 라이브러리 중 가장 유명한 Glide와 Picasso입니다 

각각 장단점은 잘 모르고 있었던터라, 한번 조사해봤어요 


Glide

Glide.with(context)
     .load(imageUrl)
     .apply(RequestOptions()
         .centerCrop()
         .placeholder(R.drawable.loading_spinner)
         .diskCacheStrategy(DiskCacheStrategy.ALL))
     .into(imageView)

장점

- GIF, webp 지원

- 이미지 로딩 성능이 좋다

- 생명주기와 연동된다 

Glide.with(context)

context가 Activity / Fragment 에 따라 해당 컴포넌트 생명주기와 연동해 동작합니다 

ex) 이미지 로딩이 진행 중인데 컴포넌트들이 파괴되면 이미지 로딩 작업이 취소됩니다 -> 성능 향상에 도움

- 썸네일 기능 지원

 

단점

- Picasso보다 복잡할 수 있다 (RequestOptions 사용)

- 메모리 사용량이 Picasso보다 많다

- 생명주기와 연동된다 

 


Picasso

Picasso.get()
       .load(imageUrl)
       .centerCrop()
       .placeholder(R.drawable.loading_spinner)
       .into(imageView)

장점

- API가 직관적

- 디버깅이 용이

단점

- GIF, webp 미지원

- 캐시 정책이 미흡