[Feature] - BE 테스트 개선 Bean Lazy Initialization 도입 #664
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✅ 작업 내용
🙈 참고 사항
기본적으로 스프링은 어플리케이션 컨텍스트가 뜰 때 모든 빈을 바로 생성합니다.
저희 테스트에서는 여러 개의 어플리케이션 컨텍스트가 뜨는데,
각 컨텍스트마다 모든 빈을 사용하지 않기 때문에 lazy 옵션을 주어 최적화 했습니다.
(해당 빈이 필요해지는 순간에 생성)
하지만 생각보다 개선이 크지는 않습니다.
제 로컬 기준 1m 32.7s -> 1m 24.3s 로 약 10% 정도 개선되었습니다.
스프링 어플리케이션 컨텍스트의 개수가 4개이고, 빈 개수 자체도 많지 않다 보니 유의미한 차이를 보이지는 않는 것 같습니다.