https://medium.com/@wodbs135/번역-constraintlayout-performance-ba92200670e

위 포스팅을 기반으로 여러가지 질문을 통하여 지식을 습득한 것을 정리한 게시글 입니다.

뷰 계층 평탄화

레이아웃 배치문제

이중 과세

ConstraintLayout vs Other Layouts

ConstraintLayout과 다른 레이아웃간 View 배치에 대해서 성능비교 결과를 알아보자.

  1. 다른 뷰의 중앙에 새로운 뷰를 배치하는 경우
    1. FrameLayout > ConstraintLayout > LinearLayout
  2. 100개의 아이템을 가진 RecyclerView
    1. ConstraintLayout > RelativeLayout > LinearLayout
  3. TextView와 Image로만 이루어진 간단한 UI
    1. LinearLayout > ConstraintLayout
      1. 아주 간단한 UI에선 LinearLayout 성능이 더 좋음.
      2. 1 depth에 자식 뷰의 위치, 크기를 구해야 하는 경우가 아닌 배치만 하는 경우라면 굳이 ConstraintLayout를 사용할 필요는 없음.
  4. Image, Text, ScrolView, Button 등 으로 이루어진 복잡한 UI
    1. ConstraintLayout > Other Layouts

참고 사항