Skip to content

⚡ Bolt: [성능 최적화] 정적 에셋 객체 분리 - #270

Closed
seonghobae wants to merge 1 commit into
masterfrom
bolt-performance-optim-static-7121890314610214293
Closed

⚡ Bolt: [성능 최적화] 정적 에셋 객체 분리#270
seonghobae wants to merge 1 commit into
masterfrom
bolt-performance-optim-static-7121890314610214293

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: process_dir 함수 내에서 매번 생성되던 큰 문자열(cssContent, css)과 정적 계산(styleHash)을 private object StaticAssets로 추출했습니다.
🎯 Why: 디렉토리 순회 과정에서 동일한 문자열과 해시 값을 반복적으로 할당하고 계산하는 것은 불필요한 메모리 및 CPU 오버헤드를 유발하기 때문입니다.
📊 Impact: 디렉토리마다 발생하던 문자열 객체 생성 및 SHA-256 해시 계산을 단 한 번만 실행하여 I/O 루프 내의 성능과 리소스 사용을 최적화했습니다.
🔬 Measurement: ./gradlew test jacocoTestReport jacocoTestCoverageVerification를 실행하여 기능 정상 작동 및 100% 테스트 커버리지를 확인했습니다.


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

`process_dir` 루프 내부에서 발생하는 불필요한 큰 문자열 할당 및 SHA-256 해시 계산을 단 한 번만 실행되도록 `StaticAssets` 객체로 추출했습니다.
@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.

Copilot AI review requested due to automatic review settings July 25, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors process_dir in the Kotlin CLI to avoid repeating static asset construction work during directory traversal, by extracting the CSS payload and its SHA-256 CSP hash into a single reusable object.

Changes:

  • Extracted the large inline CSS string and its CSP hash (styleHash) into a private object StaticAssets.
  • Updated process_dir to reference StaticAssets.styleHash and StaticAssets.css instead of recomputing them per directory.
  • Added a new performance learning entry to .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 Moves inline CSS + SHA-256 hash computation into a reusable static holder and updates CSP/CSS emission to reference it.
.jules/bolt.md Documents the optimization as a new “Bolt” learning/action entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +313 to 316
const val css = """
<style>
${cssContent} </style>
"""

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by canonical #363. The same static-assets extraction is implemented there together with exact CSP source-byte matching, an independent generated-page digest test, APA 7 doctoring, changelog, and fresh exact-head CI/JaCoCo/Security/Semgrep evidence. No evidence from this duplicate head is reused.

@seonghobae seonghobae closed this Aug 5, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by canonical #363. The same static-assets extraction is implemented there together with exact CSP source-byte matching, an independent generated-page digest test, APA 7 doctoring, changelog, and fresh exact-head CI/JaCoCo/Security/Semgrep evidence. No evidence from this duplicate head is reused.

Understood. Acknowledging that this work is now obsolete and stopping work on 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.

2 participants