From e7d303272763a8b273bae51ecf095d5a220e23e4 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 7 Sep 2026 07:35:53 +0900 Subject: [PATCH] =?UTF-8?q?perf(main):=20=ED=95=9C=20=EA=B2=B9=20=EC=95=84?= =?UTF-8?q?=EB=9E=98=20=EC=88=A8=EC=9D=80=20node=5Fmodules=20=EB=8F=84=20?= =?UTF-8?q?=EB=A6=AC=EB=A1=9C=EB=93=9C=20=EA=B0=90=EC=8B=9C=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=BA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 앞 커밋이 바로 밑의 node_modules 만 봐서 새는 곳이 있었음 — `B07_DesignDetail/openwebcad/node_modules`(15,944개)와 `A00_Common/config/node_modules`. 그 폴더들이 0.25초마다 통째로 훑히고 있었음. 한 겹 아래(`*/node_modules`)까지 보고 제외. 실측 (놀고 있는 서버, 같은 기기·같은 절차) — **CPU 85.2% → 18.3%**. 감시 대상은 파이썬 143개 · 하위폴더 39개로 줄었음. ⚠ 원인 규명은 보조 창 몫이 컸음 — 프로세스 역할이 뒤바뀌어 보였음(내가 띄운 것은 껍데기, 그 자식이 리로더, 손자가 실제 서버). 부모만 보고 재면 0% 로 보여 「앱이 먹는다」로 두 번 오진했음. 갈래 실험(reload 끔 0% / 켬 64%)이 그것을 갈랐음. 남은 18% 는 감시 탓으로 보기 어려움(파일 143개) — 별건으로 남김. Co-Authored-By: Claude Opus 5 (1M context) --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 6ec0c84c..fba1ef17 100644 --- a/main.py +++ b/main.py @@ -513,8 +513,10 @@ def _reload_dirs() -> list[str]: for entry in sorted(root.iterdir()): if not entry.is_dir() or entry.name.startswith(".") or entry.name in _RELOAD_SKIP: continue - if (entry / "node_modules").is_dir(): - continue # 의존성 트리가 안에 있으면 훑는 값이 이득을 넘는다 + # 의존성 트리가 **한 겹 아래에 숨어 있는** 경우도 뺀다 — `B07_DesignDetail/openwebcad/ + # node_modules`(15,944개)가 그렇다. 바로 밑만 보면 새어 나간다(2026-09-07 실측). + if (entry / "node_modules").is_dir() or any(entry.glob("*/node_modules")): + continue if any(entry.rglob("*.py")): watched.append(str(entry)) return watched