⚡ Bolt: [성능 개선] validate_opencode_failed_check_review.sh 파이썬 정규식 사전 컴파일#351
⚡ Bolt: [성능 개선] validate_opencode_failed_check_review.sh 파이썬 정규식 사전 컴파일#351seonghobae wants to merge 1 commit into
Conversation
… 최적화 validate_opencode_failed_check_review.sh 스크립트 내부의 Python 코드에서 반복적으로 호출되는 `clean`, `starts_new_field`, `_handle_window_start`, `_handle_continuation`, `_parse_field` 함수 내의 정규식(`re.sub`, `re.match` 등)을 모듈 레벨에서 미리 컴파일(`re.compile`)하도록 개선하여 반복적인 텍스트 파싱 과정의 성능을 향상시켰습니다.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What:
validate_opencode_failed_check_review.sh내부의 Python 코드에서 함수 내부에 인라인으로 사용되던 정규 표현식(re.sub,re.match,re.search)들을 모듈 레벨의re.compile객체로 추출하여 미리 컴파일되도록 변경했습니다.🎯 Why: 해당 파이썬 스크립트는 CI 로그 파일(수백~수천 줄에 달할 수 있음)을 한 줄씩 읽어 들이면서 파싱을 수행합니다. 루프의 각 단계에서
clean,starts_new_field,_parse_field등의 함수가 반복적으로 호출되는데, 기존 방식은 호출될 때마다 동일한 패턴의 정규식을 새로 해석/컴파일하는 오버헤드를 유발하고 있었습니다. 이를 방지하기 위한 코드베이스 특정 최적화 패턴입니다.📊 Impact: 각 라인 처리에 필요한 반복적인 정규식 컴파일 비용이 제거되어, 특히 방대한 CI 로그의
FAILED_CHECK_EVIDENCE_FILE를 처리할 때 스크립트 실행 시간이 향상됩니다.🔬 Measurement: 변경 사항은
scripts/ci/test_opencode_fact_gate_contract.sh등의 기존 팩트 게이트 계약 검증을 모두 성공적으로 통과하여 동작에 변화가 없음을 보장합니다.PR created automatically by Jules for task 6107382583812514709 started by @seonghobae