Skip to content

Commit

Permalink
내용 보충
Browse files Browse the repository at this point in the history
  • Loading branch information
yongsk0066 committed May 26, 2024
1 parent bf9e714 commit dc1edd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/content/blog/React_Compiler_2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,12 @@ expect(root).toMatchRenderedOutput( // 렌더링 결과 확인
플래그가 활성화되어 있다면, 이전에 계산된 데이터를 재사용하기에 로그 없이 렌더링이 완료된다.\
하지만 비활성화되어 있다면, 이전에 계산된 데이터를 재사용하지 않기에 'Some expensive processing... [A2]'가 찍히게 된다.
그렇게 `Data` 컴포넌트는 `A2B2`를 반환하게 된다.
비활성화되어있으면 총 3번의 비싼 계산이 일어나게 된다.\
하지만 활성화되어있으면 1번의 계산으로 끝난다. 꽤나 큰 차이이다. \
현재는 false로 되어있지만, 추후 true로 변경된다면 한차례 더 성능이 좋아질 것이다.
자 이렇게 이제 테스트 코드를 통해서 까지 `useMemoCache`의 동작을 확인해보았다.
### 마치며
Expand Down

0 comments on commit dc1edd6

Please sign in to comment.