Conversation
Bumnote
approved these changes
Dec 21, 2025
Member
Bumnote
left a comment
There was a problem hiding this comment.
프롬프트 수정 및 로직 개선하느라 고생많으셨습니다 !
src/main/java/com/spots/domain/ai/service/RecommendLLMService.java
Outdated
Show resolved
Hide resolved
| private final Semaphore llmSemaphore = new Semaphore(5); | ||
|
|
||
| public WeeklyRecommendResponse createWeeklyPlan(RecommendLLMRequest request) { | ||
| StopWatch stopWatch = new StopWatch("LLM_Generation_Task"); |
Member
There was a problem hiding this comment.
AOP 방식도 있을텐데, StopWatch를 사용하는 이유가 있을까요? 메서드 내 작업단위마다 측정하기 위해서 일까요 !?
Member
Author
There was a problem hiding this comment.
- AOP는 메서드 단위로 동작하기 때문에, 메서드 내 어느 부분에서 시간이 오래걸리는지는 확인하기 어렵다.
- AOP는 public method에서만 동작하기 때문에 private으로 되어있는
convertToRecommendProgramData내에서 병목지점을 파악하기 힘들다.
와 같은 이유가 있다고 찾았는데, 혹시 잘못된 내용있으면 수정 부탁드립니다!
| ) | ||
| .getContent(); | ||
|
|
||
| log.info("programs size: {}", programs.size()); |
Member
There was a problem hiding this comment.
기존에 협의했던 코드 포맷인 구글 형식이 아닌 것 같습니다.
Member
Author
There was a problem hiding this comment.
죄송합니다. IDE 설정이 풀려있었습니다. 재설정하여 올리겠습니다.
| List<Program> programEntities = programRepository.findAllById(programIds); | ||
| stopWatch.stop(); | ||
|
|
||
| // Map 변환 |
|
|
||
| // 2. 배치 조회 측정 | ||
| stopWatch.start("Bulk DB Fetch (findAllById)"); | ||
| List<Program> programEntities = programRepository.findAllById(programIds); |
Member
There was a problem hiding this comment.
매번 findById 하지 않고, findAllById로 모두 불러온 다음에 Map 형식으로 O(1) 접근하는 방식이 정말 인상적입니다 :>
Member
Author
There was a problem hiding this comment.
program을 50개씩만 가져오지만, 그래도 N + 1 문제를 해결해보았다는 점에서 많은 공부를 해봤습니다.
Member
There was a problem hiding this comment.
저 또한, 공부가 된 것 같습니다 :> 고생하셨습니다 !
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#️⃣ 연관된 이슈
AI 운동 루틴 요청 시 요일과 정확히 매칭되지 않는 이슈 (#23)
📝 작업 내용
💬 리뷰 요구사항