Skip to content

⚡ Bolt: Optimize file stat OS calls in crawl_directories with a single readAttributes call - #365

Open
seonghobae wants to merge 3 commits into
masterfrom
bolt-performance-crawl-directories-read-attributes-5039082079022915975
Open

⚡ Bolt: Optimize file stat OS calls in crawl_directories with a single readAttributes call#365
seonghobae wants to merge 3 commits into
masterfrom
bolt-performance-crawl-directories-read-attributes-5039082079022915975

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: crawl_directories 함수 내에서 파일이 디렉토리인지, 심볼릭 링크인지 판단하기 위해 사용하던 isDirectoryisSymbolicLink 개별 함수 파라미터를 단일 readAttributes 파라미터로 통합했습니다.
🎯 Why: 기존 방식은 각 파일마다 두 번의 독립적인 OS stat(I/O) 시스템 콜을 유발하여 디렉토리가 크거나 파일이 많을 때 병목을 일으킬 수 있습니다. 이를 단일 readAttributes 호출로 변경하여 OS I/O 오버헤드를 최소화합니다.
📊 Impact: 디렉토리 순회 시 파일 메타데이터 조회 I/O 비용 절반 가량 감소 기대.
🔬 Measurement: 디렉토리 내 파일 목록을 순회할 때 OS 레벨의 stat 시스템 콜 횟수가 줄어드는 것을 확인할 수 있으며, 기존 동작과 100% 동일한 기능을 수행하도록 모든 테스트 케이스 통과 및 커버리지(JaCoCo) 100%를 달성했습니다.


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

이전에는 `crawl_directories`에서 각 파일에 대해 `isDirectory`와 `isSymbolicLink` 2개의 개별적인 파일 시스템 I/O(stat) 호출을 수행하여 성능 저하가 발생했습니다.

이를 단일 `Files.readAttributes` 호출로 변경하여 필요한 메타데이터를 한 번에 조회하도록 최적화함으로써 중복된 I/O 오버헤드를 줄였습니다.
테스트 커버리지를 100%로 유지하기 위해 `MainTest.kt`의 테스트 인자 주입 방식도 `createMockAttributes` 헬퍼 함수를 사용하여 갱신했습니다.
@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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d6c3382a-c72e-4b2a-8706-533d5cf3627d

📥 Commits

Reviewing files that changed from the base of the PR and between 060abbb and c83210a.

📒 Files selected for processing (4)
  • .jules/bolt.md
  • plan.md
  • src/main/kotlin/html4tree/main.kt
  • src/test/kotlin/html4tree/MainTest.kt

Comment @coderabbitai help to get the list of available commands.

`crawl_directories`의 기본 파라미터로 제공된 `readAttributes` 람다에서 파일 존재하지 않을 때 `catch` 블록으로 떨어지는 예외 상황을 테스트하기 위해 `testCrawlDirectoriesDefaultLambdaException`를 추가하여 JaCoCo 커버리지 100%를 달성합니다.
`crawl_directories`의 기본 파라미터로 제공된 `readAttributes` 람다에서 파일 존재하지 않을 때 `catch` 블록으로 떨어지는 예외 상황을 테스트하기 위해 `testCrawlDirectoriesDefaultLambdaException`를 추가하여 JaCoCo 커버리지 100%를 달성합니다.
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