Skip to content

⚡ Bolt: O(N log N) 정렬 대신 O(N) 탐색 사용 - #225

Closed
seonghobae wants to merge 4 commits into
masterfrom
bolt-optimization-surveyfa-2967854970973391237
Closed

⚡ Bolt: O(N log N) 정렬 대신 O(N) 탐색 사용#225
seonghobae wants to merge 4 commits into
masterfrom
bolt-optimization-surveyfa-2967854970973391237

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

💡 What: surveyFA.R에서 최솟값을 찾을 때 사용하던 names(sort(x))[1L] 패턴을 names(x)[which.min(x)]로 변경했습니다.
🎯 Why: sort(x)를 호출하면 전체 배열을 정렬해야 하므로 O(N log N)의 시간 복잡도가 발생합니다. 최솟값 하나만 필요한 경우에는 O(N) 선형 탐색을 수행하는 which.min()을 사용하는 것이 성능상 유리합니다.
📊 Impact: 요소 수가 많은 배열에서 반복적으로 최솟값을 찾을 때 불필요한 정렬 오버헤드를 제거하여 성능을 향상시킵니다.
🔬 Measurement: R/surveyFA.R 파일 내에 which.min(p_values)가 제대로 적용되었는지 확인하고 패키지 테스트 스위트를 실행하여 정상 동작함을 확인했습니다.


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

Summary by CodeRabbit

  • 개선 사항

    • 설문 항목 선택 과정에서 최소 p-value 항목을 보다 효율적으로 식별하도록 개선했습니다.
    • 항목 제거 및 임계값 검증 동작은 기존과 동일하게 유지됩니다.
  • 문서

    • 배열의 최솟값·최댓값 탐색에 대한 개발 가이드를 추가했습니다.
    • 관련 Markdown 문서의 형식과 가독성을 개선했습니다.
  • 기타

    • 테스트 및 내부 지원 파일이 패키지 제외 목록에 반영되었습니다.

@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 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: df6393ef-459b-495a-9dec-2e020c283833

📥 Commits

Reviewing files that changed from the base of the PR and between 35e4498 and 2e4bd21.

📒 Files selected for processing (3)
  • .Rbuildignore
  • .jules/bolt.md
  • R/surveyFA.R

📝 Walkthrough

Walkthrough

p-value 후보 선택을 which.min() 기반의 선형 탐색으로 변경했습니다. 배열 최솟값·최댓값 탐색 지침을 추가하고, R 빌드 제외 패턴과 문서 서식을 갱신했습니다.

Changes

탐색 최적화 및 지원 변경

Layer / File(s) Summary
p-value 최소값 탐색 최적화
R/surveyFA.R, .jules/bolt.md
select_bad_item()이 정렬 대신 which.min()으로 최소 p-value 항목을 선택합니다. 배열 탐색 지침에 which.min()which.max()를 추가했습니다.
저장소 지원 설정 및 문서 서식
.Rbuildignore, .jules/bolt.md
테스트·Semgrep·Jules 경로를 R 빌드에서 제외합니다. Markdownlint 주석과 문서 섹션 간격을 갱신했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 정렬을 선형 탐색으로 대체하는 핵심 성능 개선을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-optimization-surveyfa-2967854970973391237

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

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #178. Both replace the full sort() used only to select the minimum p-value with linear-time which.min(). #178 provides the same optimization behind a documented helper and adds focused surveyFA regression coverage for the selection/error path, whereas this PR couples the one-line change to broad Jules/markdown/build-ignore edits. #178 is therefore the narrower behaviorally evidenced review surface. No checks, reviews, or approvals transfer.

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

Copy link
Copy Markdown

Closing as superseded by #178. Both replace the full sort() used only to select the minimum p-value with linear-time which.min(). #178 provides the same optimization behind a documented helper and adds focused surveyFA regression coverage for the selection/error path, whereas this PR couples the one-line change to broad Jules/markdown/build-ignore edits. #178 is therefore the narrower behaviorally evidenced review surface. No checks, reviews, or approvals transfer.

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.

1 participant