<aside>
📌 목차
First-Half
요약
- 이제 개발할 때 스스로에게 질문해보자.
- 이 인스턴스는 stack 에 할당될 까? 아니면 heap 에 할당 될까?
- 내가 이 인스턴스를 copy할 때, 얼마나 많은 reference overhead 를 일으킬까?
- 내가 이 인스턴스의 메서드를 호출할 때, 이것은 statically dispatch 될까? 아니면 dynamically dispatch 될까?
- 우리에게 필요하지 않은 dynamism 을 위해 오버헤드를 감당하는 것은 우리 성능에 큰 해가 될 것이다.
Dimension of performance
- Allocation : Stack or Heap
- Reference Counting : Less or More
- Method Dispatch : Static or Dynamic
Allocation
Swift 는 알아서 메모리 관리를 해준다.
Allocation = 할당, 메모리에 사용할 공간을 확보하는 것.
소주제