Skip to content

⚡ Bolt: 성능 향상을 위한 재사용 가능한 HexFormat 적용#127

Open
seonghobae wants to merge 4 commits into
mainfrom
bolt-perf-hexformat-13660668014919458053
Open

⚡ Bolt: 성능 향상을 위한 재사용 가능한 HexFormat 적용#127
seonghobae wants to merge 4 commits into
mainfrom
bolt-perf-hexformat-13660668014919458053

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What:

  • DefaultDocumentConversionService, ArtifactLinkService, DefaultDocumentValidationService 클래스에 재사용 가능한 private static final HexFormat HEX_FORMAT = HexFormat.of(); 상수를 선언했습니다.
  • 기존 반복문 기반의 String.format("%02x", b) 바이트 단위 변환 및 HexFormat.of().formatHex(...)의 반복적인 인스턴스 생성 코드를 미리 생성된 HEX_FORMAT.formatHex(...)로 교체했습니다.
  • 성능 저하 요인과 최적화 패턴에 대한 교훈을 .jules/bolt.md에 기록했습니다.

🎯 Why:

  • String.format은 내부적으로 여러 객체를 생성하고 복잡한 정규표현식 파싱을 거치기 때문에 단순한 바이트 배열의 Hex 문자열 변환 용도로 반복 호출하면 메모리 할당과 GC 오버헤드를 크게 증가시킵니다.
  • 매번 HexFormat.of()를 호출하는 것 역시 불필요한 인스턴스 생성을 야기합니다.
  • 변경된 코드는 불필요한 객체 생성을 막아 CPU 및 메모리 사용을 절감하고, 가독성을 높입니다.

📊 Impact:

  • 해싱 및 변환 작업 등에서 Hex 문자열을 생성할 때 발생하는 불필요한 메모리 할당과 GC 작업이 획기적으로 줄어들어 처리 속도가 빨라지고 메모리 사용량이 감소합니다.

🔬 Measurement:

  • mvn testmvn org.jacoco:jacoco-maven-plugin:prepare-agent test org.jacoco:jacoco-maven-plugin:report 명령어로 기존 테스트들이 깨지지 않았으며 커버리지가 100%를 유지함을 확인했습니다.

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

Hex 변환을 위해 String.format("%02x", b)를 반복문 내에서 사용하거나 반복적으로 HexFormat.of() 인스턴스를 생성하는 방식은 불필요한 객체 생성을 초래합니다.

이를 해결하기 위해 DefaultDocumentConversionService, ArtifactLinkService, DefaultDocumentValidationService 클래스에 재사용 가능한 private static final java.util.HexFormat 상수(HEX_FORMAT)를 도입하고 변환 로직을 최적화했습니다.

이 최적화는 애플리케이션의 메모리 할당 및 가비지 컬렉션(GC) 부하를 줄여 성능을 향상시킵니다. 관련 내용은 .jules/bolt.md에 기록되었습니다.
@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.

Hex 변환을 위해 String.format("%02x", b)를 반복문 내에서 사용하거나 반복적으로 HexFormat.of() 인스턴스를 생성하는 방식은 불필요한 객체 생성을 초래합니다.

이를 해결하기 위해 DefaultDocumentConversionService, ArtifactLinkService, DefaultDocumentValidationService 클래스에 재사용 가능한 private static final java.util.HexFormat 상수(HEX_FORMAT)를 도입하고 변환 로직을 최적화했습니다.

이 최적화는 애플리케이션의 메모리 할당 및 가비지 컬렉션(GC) 부하를 줄여 성능을 향상시킵니다. 관련 내용은 .jules/bolt.md에 기록되었습니다.

이전 리뷰를 반영하여 기존의 PII 로깅 해싱 기능 변경을 롤백하고 본래 기능만을 유지하도록 수정했습니다.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions github-actions Bot 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

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head ec42116882080c65028c19b353e366885f049149.

  • Head SHA: ec42116882080c65028c19b353e366885f049149

  • Workflow run: 29057745649

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
Loading

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 2bf90cae7630159987ed4a831eddb9b157086983
  • Workflow run: 29058661401
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 2bf90cae7630159987ed4a831eddb9b157086983.

  • Head SHA: 2bf90cae7630159987ed4a831eddb9b157086983

  • Workflow run: 29058661401

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (5 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (5 files)"]
  R1 --> V1["required checks"]
Loading

Hex 변환을 위해 String.format("%02x", b)를 반복문 내에서 사용하거나 반복적으로 HexFormat.of() 인스턴스를 생성하는 방식은 불필요한 객체 생성을 초래합니다.

이를 해결하기 위해 DefaultDocumentConversionService, ArtifactLinkService, DefaultDocumentValidationService 클래스에 재사용 가능한 private static final java.util.HexFormat 상수(HEX_FORMAT)를 도입하고 변환 로직을 최적화했습니다.

이 최적화는 애플리케이션의 메모리 할당 및 가비지 컬렉션(GC) 부하를 줄여 성능을 향상시킵니다. 관련 내용은 .jules/bolt.md에 기록되었습니다.

이전 리뷰를 반영하여 기존의 PII 로깅 해싱 기능 변경을 롤백하고 본래 기능만을 유지하도록 수정했습니다. 또한, CI 빌드 실패의 원인이었던 취약한 `jackson-databind` 버전을 보안 권고에 맞게 2.18.4 버전으로 업데이트하여 CI trivy-fs 에러를 해결했습니다.

@github-actions github-actions Bot 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

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 2bf90cae7630159987ed4a831eddb9b157086983.

  • Head SHA: 2bf90cae7630159987ed4a831eddb9b157086983

  • Workflow run: 29058661401

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (5 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (5 files)"]
  R1 --> V1["required checks"]
Loading

Hex 변환을 위해 String.format("%02x", b)를 반복문 내에서 사용하거나 반복적으로 HexFormat.of() 인스턴스를 생성하는 방식은 불필요한 객체 생성을 초래합니다.

이를 해결하기 위해 DefaultDocumentConversionService, ArtifactLinkService, DefaultDocumentValidationService 클래스에 재사용 가능한 private static final java.util.HexFormat 상수(HEX_FORMAT)를 도입하고 변환 로직을 최적화했습니다. 최적화된 코드에 주석을 추가하였습니다.

이 최적화는 애플리케이션의 메모리 할당 및 가비지 컬렉션(GC) 부하를 줄여 성능을 향상시킵니다. 관련 내용은 .jules/bolt.md에 기록되었습니다.

이전 리뷰를 반영하여 기존의 PII 로깅 해싱 기능 변경을 롤백하고 본래 기능만을 유지하도록 수정했습니다. 또한, CI 빌드 실패의 원인이었던 취약한 jackson 의존성을 해결하기 위해 `jackson-bom`을 2.18.4 버전으로 `dependencyManagement`에 명시하여 CI trivy-fs 에러를 해결했습니다.
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