Skip to content

⚡ Bolt: 최솟값 탐색 정렬 병목(O(N log N)) 제거 및 성능 최적화 - #206

Open
seonghobae wants to merge 4 commits into
masterfrom
bolt/surveyFA-optimization-16088346372224250161
Open

⚡ Bolt: 최솟값 탐색 정렬 병목(O(N log N)) 제거 및 성능 최적화#206
seonghobae wants to merge 4 commits into
masterfrom
bolt/surveyFA-optimization-16088346372224250161

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

💡 What: surveyFA.R 내부에서 데이터의 최소값을 추출할 때 발생하는 전체 배열 정렬(sorting) 과정을 선형 스캔(linear scan)으로 변경하였습니다.
🎯 Why: sort(p_values)[1L]로 가져오는 접근 방식은 전체 데이터를 $O(N \log N)$ 비용으로 정렬하여 불필요한 성능 저하를 유발합니다. 단순 최소값의 인덱스를 반환하는 which.min을 활용하면 $O(N)$의 시간 복잡도로 빠르게 처리할 수 있습니다.
📊 Impact: 반복적으로 수행되는 모델 평가 루틴에서 불필요한 정렬 오버헤드를 감소시켜 R 환경의 실행 속도 및 성능을 개선합니다.
🔬 Measurement: 패키지의 로컬 설치 및 testthat 테스트가 100% 정상 통과함을 확인했습니다.


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

Summary by CodeRabbit

  • 개선 사항
    • 적합도 p-value가 가장 작은 문항을 더 효율적으로 선택하도록 개선했습니다.
    • 관련 학습 문서의 가독성을 높이기 위해 줄바꿈과 일부 제목을 정리했습니다.
    • 최솟값·최댓값 탐색 방법에 대한 학습 내용을 추가했습니다.

@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 3, 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: 99c08cd3-7df7-4fbf-b5f3-4f3230034df9

📥 Commits

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

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

📝 Walkthrough

Walkthrough

select_bad_item()이 정렬 대신 which.min()을 사용합니다. .jules/bolt.md는 기존 최적화 학습 항목의 형식을 정리하고 which.min()which.max() 사용법을 추가합니다.

Changes

최솟값 탐색 최적화

Layer / File(s) Summary
최솟값 선택 로직 변경
R/surveyFA.R
select_bad_item()이 적합도 p-value를 정렬한 뒤 첫 항목을 선택하는 대신 which.min()으로 최솟값의 위치를 찾습니다.
최적화 학습 기록 정리
.jules/bolt.md
기존 학습 항목의 줄바꿈과 제목을 정리했습니다. sort() 대신 which.min() 또는 which.max()를 사용하는 항목을 추가했습니다.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: copilot

🚥 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 제목은 전체 정렬을 제거하고 which.min()으로 최솟값 탐색 성능을 개선한 주요 변경 사항을 정확히 요약합니다.
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/surveyFA-optimization-16088346372224250161

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

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

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 2f980414f5c02da4120e6b94a04c707f599f0709.

  • Head SHA: 2f980414f5c02da4120e6b94a04c707f599f0709

  • Workflow run: 30854229434

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

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

@opencode-agent

opencode-agent Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 2f980414f5c02da4120e6b94a04c707f599f0709
  • Workflow run: 30854229434
  • 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 2f980414f5c02da4120e6b94a04c707f599f0709.

  • Head SHA: 2f980414f5c02da4120e6b94a04c707f599f0709

  • Workflow run: 30854229434

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

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

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