Skip to content

⚡ Bolt: 성능 개선 - 16진수 문자열 변환 최적화 (HexFormat 적용)#122

Open
seonghobae wants to merge 4 commits into
mainfrom
bolt-optimize-hex-conversion-245679331598799598
Open

⚡ Bolt: 성능 개선 - 16진수 문자열 변환 최적화 (HexFormat 적용)#122
seonghobae wants to merge 4 commits into
mainfrom
bolt-optimize-hex-conversion-245679331598799598

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What:
바이트 배열을 16진수 문자열로 변환할 때 루프 내에서 String.format("%02x", b)를 사용하는 기존 방식을 Java 17 이상에서 지원하는 java.util.HexFormat.of().formatHex(raw)로 변경했습니다.

🎯 Why:
String.format은 정규 표현식 파싱 및 포맷 검증 등 여러 무거운 작업을 수반하며, 루프 안에서 호출될 경우 상당한 성능 저하와 불필요한 객체 생성을 유발합니다. 특히 파일 해시 생성(SHA-256) 등 빈번하게 발생하는 작업에서 이 병목 현상이 두드러질 수 있습니다.

📊 Impact:

  • HexFormat을 사용함으로써 16진수 변환 속도가 크게 향상되고, 메모리 할당량이 줄어듭니다 (가비지 컬렉터 부하 감소).
  • String.format의 오버헤드가 제거되어 애플리케이션의 전반적인 응답성과 리소스 효율성이 소폭 개선될 것으로 기대됩니다.
  • 코드의 가독성 또한 3줄의 루프가 1줄로 단축되어 향상되었습니다.

🔬 Measurement:

  • mvn test를 실행하여 기존 유닛 테스트들이 100% 통과함을 확인했습니다 (해시 값 생성 로직이 기존과 동일하게 동작함).
  • Checkstyle (mvn -DskipTests checkstyle:check)을 통과함을 확인했습니다.

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

- `String.format`을 루프에서 사용하여 바이트 배열을 16진수 문자열로 변환하는 비효율적인 로직을 Java 17+의 `java.util.HexFormat`을 사용하도록 리팩토링했습니다.
- `DefaultDocumentConversionService`와 `ArtifactLinkService`의 두 곳에 적용되었습니다.
- 이는 불필요한 문자열 생성 및 포맷팅 오버헤드를 줄여 실행 속도를 높이고 메모리 할당을 줄입니다. 가독성 또한 향상됩니다.
@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.

@seonghobae seonghobae enabled auto-merge (squash) July 9, 2026 01:21
- `String.format`을 루프에서 사용하여 바이트 배열을 16진수 문자열로 변환하는 비효율적인 로직을 Java 17+의 `java.util.HexFormat`을 사용하도록 리팩토링했습니다.
- `DefaultDocumentConversionService`와 `ArtifactLinkService`의 두 곳에 적용되었습니다.
- 이는 불필요한 문자열 생성 및 포맷팅 오버헤드를 줄여 실행 속도를 높이고 메모리 할당을 줄입니다. 가독성 또한 향상됩니다.
- `String.format`을 루프에서 사용하여 바이트 배열을 16진수 문자열로 변환하는 비효율적인 로직을 Java 17+의 `java.util.HexFormat`을 사용하도록 리팩토링했습니다.
- `DefaultDocumentConversionService`와 `ArtifactLinkService`의 두 곳에 적용되었습니다.
- 이는 불필요한 문자열 생성 및 포맷팅 오버헤드를 줄여 실행 속도를 높이고 메모리 할당을 줄입니다. 가독성 또한 향상됩니다.
@opencode-agent

opencode-agent Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 6531c9e5294fb6461401dc97d08cac31632ab470
  • Workflow run: 28975622453
  • Workflow attempt: 1
  • Gate result: APPROVE (exit 0)

Changed-File Evidence Map

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

- `String.format`을 루프에서 사용하여 바이트 배열을 16진수 문자열로 변환하는 비효율적인 로직을 Java 17+의 `java.util.HexFormat`을 사용하도록 리팩토링했습니다.
- `DefaultDocumentConversionService`와 `ArtifactLinkService`의 두 곳에 적용되었습니다.
- 이는 불필요한 문자열 생성 및 포맷팅 오버헤드를 줄여 실행 속도를 높이고 메모리 할당을 줄입니다. 가독성 또한 향상됩니다.
@opencode-agent opencode-agent Bot disabled auto-merge July 11, 2026 11:44
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