Skip to content

⚡ Bolt: 루프 내 배열 탐색 연산 캐싱 최적화#110

Open
seonghobae wants to merge 1 commit into
masterfrom
bolt-performance-optimization-18987335221499488
Open

⚡ Bolt: 루프 내 배열 탐색 연산 캐싱 최적화#110
seonghobae wants to merge 1 commit into
masterfrom
bolt-performance-optimization-18987335221499488

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: R/aFIPC.R 내 공통 문항을 반복하며 모수를 할당/출력하는 for 루프에서, 중복되어 쓰이는 which() 함수의 반환값을 변수(new_idx, old_idx)에 캐싱하고 불필요하게 단일 문자열을 감싸고 있던 paste0()를 제거했습니다.
🎯 Why: 루프 내의 조건부 서브셋 조회에서, 매 조회 시마다 벡터 전체를 스캔하는 O(N) 연산이 한 루프 사이클에서 최대 4번 발생했습니다. 이 부분의 복사 및 탐색 오버헤드를 변수에 캐시하여 O(1) 할당 연산으로 줄이고, 쓸모없는 함수 호출(paste0)을 없애 앱의 성능을 향상시키기 위함입니다.
📊 Impact: 문항 수가 클수록 O(N)의 중복 탐색을 줄여 성능 향상이 매우 크게 체감될 것입니다. 문자열 복사 오버헤드도 축소되었습니다.
🔬 Measurement: Rscript -e "testthat::test_dir('tests/testthat')"를 통해 모든 테스트가 무결하게 패스되며, Rscript -e 'covr::package_coverage()' 명령을 통해 테스트 커버리지가 하락하지 않았음을 확인할 수 있습니다.


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

@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.

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