perf(harness): parallel audience search under one global budget (#897 step 2) - #995
Open
jinon86 wants to merge 3 commits into
Open
perf(harness): parallel audience search under one global budget (#897 step 2)#995jinon86 wants to merge 3 commits into
jinon86 wants to merge 3 commits into
Conversation
…step 2) The audience-private SessionStart path ran four independent DB searches serially (local 3s + recent 1s + shared 3s + legacy 2s = up to ~9s of the 15s hook budget). They now run concurrently and the hook waits on ONE global budget (default 3s, CCC_MEMORY_SEARCH_GLOBAL_TIMEOUT_SEC); each lane keeps its inner hard timeout (SIGTERM->SIGKILL process-group) so a cut wait never orphans an unbounded search. CCC_MEMORY_SEARCH_PARALLEL=0 restores the serial path; without EPOCHREALTIME or on mktemp failure the code falls back to the exact serial block; non-audience mode is unchanged. Measured with a 2s-per-lane stub fixture: serial 8.1s -> parallel 3.0s. The step-1 timing instrumentation gains a consolidated search_parallel stage mark; serial mode keeps the per-lane marks. Tests: memory-hooks suite gains parallel-merge, consolidated-mark, budget-cut (stalled lane dropped, hook still completes) and serial-fallback cases (47/47); ccc-memory 131/131.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#897 2단계 — 검색 병렬화 + 전역 예산
1단계(#991, 계측)가 머지됐으므로 이슈의 고정 순서상 다음 단계입니다.
변경
audience-private SessionStart의 4개 검색 레인(local 3s → recent 1s → shared 3s → legacy 2s, 직렬 최대 ~9초)을 병렬로 바꾸고, 대기는 전역 3초 예산(
CCC_MEMORY_SEARCH_GLOBAL_TIMEOUT_SEC) 하나로 제한합니다.CCC_MEMORY_SEARCH_PARALLEL=0이면 기존 직렬 경로 그대로 / EPOCHREALTIME 부재·mktemp 실패 시에도 직렬 블록으로 폴백 / 비audience 모드 무밀경search_parallel통합 마크, 직렬 모드는 기존 레인별 마크 유지실측 (2초/레인 스텁)
검증
후속
3단계(memory_render.py 통합 렌더)·4단계(setup.sh)는 별도 PR. 1단계 실측 데이터가 쌓이면 검증에 활용.