⚡ Bolt: [성능 개선] FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거 - #200
⚡ Bolt: [성능 개선] FileSystemArtifactStore에서 불필요한 Files.exists() 호출 제거#200seonghobae wants to merge 1 commit into
Conversation
* `Files.exists()` 호출과 `Files.readAllBytes()` 간에 발생할 수 있는 TOCTOU (Time-Of-Check to Time-Of-Use) 경쟁 상태를 방지하기 위해 파일의 존재 여부 확인을 생략합니다. * 파일 읽기를 바로 시도하고 `NoSuchFileException` 예외를 처리하여 파일 시스템의 stat 시스템 콜을 1회 줄여 성능을 향상시켰습니다.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
Optimizes artifact PDF loading in the Clearfolio Viewer by removing a pre-read filesystem existence check and relying on NIO’s missing-file exception handling, reducing redundant syscalls and eliminating a TOCTOU window on the read path.
Changes:
- Removed
Files.exists()check before reading PDFs from disk. - Added explicit handling of
NoSuchFileExceptionto returnOptional.empty()when the artifact is missing. - Documented the optimization and rationale in
.jules/bolt.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/com/clearfolio/viewer/artifact/FileSystemArtifactStore.java | Removes redundant existence check and handles missing-file via NoSuchFileException during reads. |
| .jules/bolt.md | Adds a Bolt entry documenting the TOCTOU + syscall-overhead rationale and the preferred pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Superseded by #222.