⚡ Bolt: 불필요한 메모리 할당 방지를 위한 정적 에셋 추출#234
Conversation
- 디렉토리 반복 시 매번 생성되던 CSS 문자열과 SHA-256 연산을 object로 추출 - 메모리 사용량 및 I/O 오버헤드 감소
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
process_dir에서 매 디렉토리 처리마다 생성되던 CSS 문자열과 SHA-256 해시 계산을 파일 스코프의 private object StaticAssets로 이동해, 정적 자산이 1회만 초기화되도록 최적화합니다.
Changes:
StaticAssets로 CSS 본문과 CSP용 스타일 해시 계산을 분리하여 반복 할당/연산을 제거process_dir의 CSP meta 및<style>삽입이StaticAssets를 참조하도록 수정- 성능 최적화 학습/조치 내용을
.jules/bolt.md에 기록
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/kotlin/html4tree/main.kt | CSS/해시를 정적 객체로 추출하고 process_dir에서 정적 참조로 사용 |
| .jules/bolt.md | 정적 에셋 및 해시 계산 추출 최적화에 대한 학습/조치 로그 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const val css = """ | ||
| <style> | ||
| ${cssContent} </style> | ||
| """ |
💡 What:
process_dir루프 안에 있던 CSS 문자열 선언과 SHA-256 해시 계산을private object StaticAssets로 분리하여 한 번만 계산되도록 최적화했습니다.🎯 Why: 디렉토리를 재귀적으로 처리할 때마다 크기가 큰 CSS 문자열을 새로 생성하고 해시 계산하는 것은 불필요한 CPU 및 메모리 낭비를 유발하는 성능 병목이었습니다.
📊 Impact: 디렉토리 순회당 객체 할당과 해싱 비용이 제거되어 대규모 디렉토리 트리 생성 시 메모리 사용량과 실행 시간이 감소합니다.
🔬 Measurement: 대량의 디렉토리가 있는 환경에서
./gradlew run --args="<dir>"수행 시 프로파일러를 통한 메모리 할당량 및 실행 시간 비교.PR created automatically by Jules for task 5144178025771631214 started by @seonghobae