-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Bolt: stats::na.omit() 오버헤드 제거 및 고유값 산출 최적화 #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
2
commits into
master
Choose a base branch
from
bolt/optimize-na-omit-15314050508607312160
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+18
−2
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- a/.jules/bolt.md | ||
| +++ b/.jules/bolt.md | ||
| @@ -16,6 +16,5 @@ | ||
| ## 2025-02-12 - R 언어에서 반복적인 mirt 모델 생성 시 불필요한 데이터프레임 부분집합 추출 최적화 | ||
| **Learning:** R에서 데이터프레임의 특정 열을 추출하는 작업(`df[cols]`)은 O(N)의 메모리 복사를 수반합니다. `autoFIPC`에서 `mirt` 모델의 파라미터를 설정하거나 호출하는 과정 중에 `newformXDataK[colnames(newFormModel@Data$data)]` 코드가 반복해서 사용되었고, 심지어 `ncol()`을 위해 단순히 개수를 구할 때도 사용되어 불필요한 메모리 할당과 오버헤드를 초래했습니다. | ||
| **Action:** 조건문이나 반복문 내부에서 불필요하게 데이터프레임 부분집합 연산이 반복되지 않도록 외부에서 한 번만 `linkedFormData <- newformXDataK[colnames(newFormModel@Data$data)]`로 캐싱(caching)한 뒤, `ncol(linkedFormData)`와 `data = linkedFormData` 형태로 재사용하여 메모리 복사와 O(N) 오버헤드를 방지해야 합니다. | ||
| -## 2024-03-22 - R 언어에서 고유값 개수 산출 시 stats::na.omit() 오버헤드 최적화 | ||
| -**Learning:** R에서 데이터 내 고유(unique) 비결측치(NA 제외) 값의 개수를 셀 때 `length(stats::na.omit(unique(x)))`를 사용하면 `stats::na.omit()` 함수의 내부 메소드 디스패치 및 `na.action` 속성 할당 오버헤드로 인해 성능 저하가 발생합니다. | ||
| -**Action:** `sum(!is.na(unique(x)))`와 같은 논리 인덱스 합산 방식을 사용하여 불필요한 속성 할당 및 함수 오버헤드를 제거함으로써 성능을 최적화해야 합니다. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🤖 get_repo_knowledge executed:
get_repo_knowledge ContextualWisdomLab/aFIPC /tmp/coderabbit-repo-knowledge/contextualwisdomlab-afipc-649c8ab4/conventionsLength of output: 8070
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 50382
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 16992
🏁 Script executed:
Repository: ContextualWisdomLab/aFIPC
Length of output: 5662
PR 요약에 삭제 전제와 위험 평가를 추가하세요.
fix_journal.patch는.jules/bolt.md에 연속으로 중복된 동일 기록 중 하나만 삭제합니다. 런타임 코드는 변경하지 않지만, 저장소 지침은 커밋/PR 요약에 전제와 위험을 문서화하도록 요구합니다. 삭제가 중복 기록 정리라는 전제와,.jules/bolt.md가 빌드에서 제외되며 저장소 내 소비자 참조가 없어 동작 영향이 없다는 위험 평가를 PR 요약에 명시하세요.🤖 Prompt for AI Agents