From 67a20e13b302355c3ec1817ab27130bc2d1eb577 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 12 Jul 2026 18:05:51 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20pre-compile=20regex=20to=20?= =?UTF-8?q?speed=20up=20normalize=5Freport=5Fpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scripts/ci/strix_quick_gate.sh 내에서 빈번하게 호출되는 normalize_report_path 함수의 정규표현식을 매번 다시 컴파일하는 문제(O(N) overhead)를 해결하기 위해, 모듈 레벨에서 re.compile()을 사용하여 성능을 최적화했습니다. --- scripts/ci/strix_quick_gate.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ci/strix_quick_gate.sh b/scripts/ci/strix_quick_gate.sh index 1adcf09c..9f5d2661 100755 --- a/scripts/ci/strix_quick_gate.sh +++ b/scripts/ci/strix_quick_gate.sh @@ -3260,10 +3260,12 @@ record_paths = { if not record_paths: raise SystemExit(1) +# ⚡ Bolt: Pre-compile regex for path normalization to optimize inner loop scanning +location_suffix_re = re.compile(r":\d+(?:-\d+)?$") def normalize_report_path(raw: str) -> str | None: value = raw.strip().strip("`").replace("\\", "/") - value = re.sub(r":\d+(?:-\d+)?$", "", value) + value = location_suffix_re.sub("", value) for record_path in record_paths: if value == record_path or value.endswith("/" + record_path): return record_path