Repository navigation
perf(compile): keep native analysis parallel at 10k models - #934
Merged
Merged
Conversation
Drop the size heuristic that ran compact native analysis on one worker for projects with at least 10,000 models and 48 MiB of SQL. Peak memory is set by the rules phase, not analysis, so four workers do not raise it. Build and serialize the native rules request before custom rules start and outside the native error boundary, then release the request object tree and its JSON bytes before native evaluation, removing two full-project copies from the peak. Builder programming errors keep propagating unchanged. Pin the worker decision and the builder error semantics with unit tests and tighten the dense 10,000-model peak RSS budget from 4 GiB to 3.5 GiB.
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.
Why
Native model analysis was forced to a single worker for projects with at least 10,000 models and 48 MiB of SQL, to save memory before the custom-rule hosts start. Measurement shows analysis is not where memory peaks: the peak comes later, in the rules phase. The cap left 3 of 4 cores idle at 10k (CHI-449).
Changes
Verification
--no-cache, 4 GiB cgroup (base → head): native analysis 5.8 → 1.3 s; main-process peak about 2.9 → 2.7 GB; whole process group 4.11 → 3.85 GB. Fingerprints match the pinned values at 3k/5k/10k.make test,make check-ci.