Skip to content

⚡ Bolt: 정적 변수 호이스팅을 통한 해시 연산 및 메모리 할당 최적화#215

Open
seonghobae wants to merge 1 commit into
masterfrom
bolt-hoist-constants-1405509924760948397
Open

⚡ Bolt: 정적 변수 호이스팅을 통한 해시 연산 및 메모리 할당 최적화#215
seonghobae wants to merge 1 commit into
masterfrom
bolt-hoist-constants-1405509924760948397

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: process_dir 내부에 있던 정적인 cssContent, styleHash, css 변수들을 파일 최상단의 private val로 이동시켰습니다.
🎯 Why: 디렉토리를 순회할 때마다 매번 변경되지 않는 큰 CSS 문자열을 생성하고 SHA-256 해시를 계산하는 것은 엄청난 성능 저하와 불필요한 메모리 할당을 유발합니다. 이를 전역 변수(호이스팅)로 분리하여 애플리케이션 실행 시 단 한 번만 계산되도록 합니다. private val을 사용하여 불필요한 getter 생성을 막아 커버리지 100%를 유지합니다.
📊 Impact: 수많은 디렉토리를 처리할 때, 각 디렉토리마다 발생하던 해시 연산(O(D))과 힙 메모리 할당이 제거되어 렌더링 속도가 크게 향상되고 가비지 컬렉션(GC) 부하가 감소합니다.
🔬 Measurement: Jacoco 테스트 커버리지 리포트 실행(100% 유지 확인) 및 디렉토리 크롤링 실행 시간(벤치마크) 감소 확인.


PR created automatically by Jules for task 1405509924760948397 started by @seonghobae

@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant