Skip to content

⚡ Bolt: [성능 향상] 정적 자산(CSS 및 Hash) 추출을 통한 반복 할당 방지#210

Open
seonghobae wants to merge 1 commit into
masterfrom
bolt-optimize-static-assets-6819158801546065384
Open

⚡ Bolt: [성능 향상] 정적 자산(CSS 및 Hash) 추출을 통한 반복 할당 방지#210
seonghobae wants to merge 1 commit into
masterfrom
bolt-optimize-static-assets-6819158801546065384

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: process_dir 루프 내부에서 매 디렉토리마다 계산되던 정적인 CSS 문자열 할당과 SHA-256 해시 연산을 파일 상단 StaticAssets 싱글톤(private object)으로 추출하고 const val@JvmField를 통해 한 번만 계산되도록 최적화했습니다.

🎯 Why: 디렉토리 크롤링(재귀)에서 가장 많이 호출되는 함수 내부에 고비용의 문자열 할당(Multiline string) 및 Base64 인코딩, MessageDigest 해싱 작업이 위치해 있었습니다. 동일한 값에 대한 반복 연산을 줄여 GC 압력을 낮추고 전체적인 크롤링 성능을 극대화하기 위해 이를 최적화했습니다.

📊 Impact: 디렉토리를 순회할 때마다 발생하던 수백 바이트의 불필요한 문자열 할당 및 CPU 집중적인 해시 함수 호출 횟수를 N(디렉토리 수)회에서 1회로 감소시켰습니다.

🔬 Measurement: 100% 테스트 커버리지가 유지되었으며(JaCoCo), TestConst3.kt 등을 이용한 로컬 JVM 초기화 확인을 통해 MessageDigest.getInstance("SHA-256")가 단 1회만 호출됨을 보장합니다.


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

Extracted CSS content, SHA-256 hash, and the `<style>` block to a private top-level `StaticAssets` object using `const val` and `@JvmField`. This prevents redundant multi-line string allocations and expensive hash computations for every directory processed in the recursive crawler, significantly reducing CPU cycles and Garbage Collector overhead while strictly preserving 100% JaCoCo coverage.
@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