Skip to content

revert(perf): retire unmeasured R micro-optimizations - #298

Closed
seonghobae wants to merge 3 commits into
masterfrom
bolt/optimize-which-min-and-unique-sum-13250550206503932288
Closed

revert(perf): retire unmeasured R micro-optimizations#298
seonghobae wants to merge 3 commits into
masterfrom
bolt/optimize-which-min-and-unique-sum-13250550206503932288

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

No-valid-delta closure after repair.

Fresh review applied the repository's numerical-behavior guardrail rather than treating passing legacy tests as performance evidence. The branch originally mixed two micro-optimizations with broad 2–3× claims but supplied no repository-controlled benchmark artifact fixing representative data shapes/classes, R/runtime version, CPU, warm-up/repetition, allocation/GC, or an end-to-end calibration/linking performance measure.

The extrema rewrite was already withdrawn on predecessor repair 20fd14400e8329f865a1e1989d3c37a69578f836, and its generated .jules/bolt.md doctrine was removed. The only remaining production delta changed distinct-non-NA counting in R/aFIPC.R and R/surveyFA.R. Although review classified the common standard-vector result as numerically equivalent, this repository explicitly prioritizes historical numerical behavior in R/aFIPC.R and requires regression evidence before algorithmic edits. There was still no focused class/NA edge contract or measured buyer/runtime benefit justifying that production churn.

Repair head 50527c4441b5b6b1734f032777c7d7c6a2ddaf3e is a normal non-force descendant that adopts protected master@f87c2324f1686135e57d8730c1b0b9420874f300 while preserving all experimental history. Fresh compare is ahead-only (ahead_by=3, behind_by=0) with files=[]. Both informational review threads are resolved against the restored tree.

There is therefore no production/test/doc semantic delta left to integrate. A future optimization should start with a reproducible representative benchmark/profile, explicit equivalence fixtures for the affected R classes/NA cases, and then a minimal measured change.

1. `R/surveyFA.R`: `names(sort(x))[1L]`를 `names(which.min(x))`로 교체하여 O(N log N) 정렬 비용을 없애고 O(N) 선형 탐색으로 최적화함.
2. `R/surveyFA.R`, `R/aFIPC.R`: `length(stats::na.omit(unique(x)))` 및 `length(unique(stats::na.omit(x)))`를 `sum(!is.na(unique(x)))`로 대체함. `stats::na.omit` 호출로 인한 불필요한 S3 메서드 디스패치 및 `na.action` 속성 할당(메모리 오버헤드)을 제거하고 순수 논리 벡터 연산으로 성능을 향상시킴.
3. `.jules/bolt.md`: 해당 최적화와 관련된 R 성능 향상 지식 기록 추가.
@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 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 8bfd9e60-5dd4-484b-95ad-9bc6dd66d74e

📥 Commits

Reviewing files that changed from the base of the PR and between 6e5f353 and 20fd144.

📒 Files selected for processing (1)
  • R/surveyFA.R

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: d4627151-e398-4f57-8c74-882af3771ad7

📥 Commits

Reviewing files that changed from the base of the PR and between f87c232 and 6e5f353.

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

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

R 코드의 고유값 개수 계산을 sum(!is.na(unique(...)))로 변경했습니다. 최소 p-value 항목 선택에는 which.min()을 사용합니다. 두 최적화 내용을 학습 노트에 추가했습니다.

Changes

R 성능 최적화

Layer / File(s) Summary
최적화 구현 및 학습 노트
R/aFIPC.R, R/surveyFA.R, .jules/bolt.md
NA가 아닌 고유값 개수를 직접 계산하도록 변경했습니다. 최소 p-value 항목 선택에서 전체 정렬을 제거하고 which.min()을 사용합니다. 두 변경 내용을 학습 노트에 기록했습니다.

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

Merge Risk: ⚪ Minimal · up to 6e5f3

This change replaces equivalent R implementations with more efficient minimum lookup and unique non-NA counting, with no actionable merge-blocking risk remaining after normal checks and review.

🚥 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 제목은 R 성능 최적화라는 주요 변경 사항과 which.min, 유니크 개수 계산 최적화를 구체적으로 설명합니다. 변경 내용과 직접 관련되며 간결합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/optimize-which-min-and-unique-sum-13250550206503932288

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment thread R/surveyFA.R Outdated
Comment thread R/aFIPC.R Outdated
@seonghobae
seonghobae marked this pull request as draft September 4, 2026 20:06
@seonghobae seonghobae changed the title ⚡ Bolt: R 성능 최적화 (which.min 및 유니크 카운트) revert(perf): retire unmeasured R micro-optimizations Sep 4, 2026
@seonghobae seonghobae closed this Sep 4, 2026
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