Skip to content

Commit 6424a98

Browse files
committed
docs(ci): scope the RSS rule to the in-flight term
The `--jobs` sizing guidance read as a process-wide bound, and it is one only where the destination does not retain finished results. `metrics --output <FILE>` sends every space over an unbounded channel and collects it after the walk, and structured stdout holds completed documents while an earlier file is still being analyzed — worst exactly when one large file sorts early, which is the shape this change was measured on. `--output-dir` writes per document and `bca check` reduces each file to its violations, so those two stay at the in-flight bound. State the formula as the in-flight term, name the destinations that add a result-set term, and point a memory-limited runner at `--output-dir`.
1 parent 03cb037 commit 6424a98

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ for historical reference.
4040
`-j 16`: 488 MB → 439 MB. No metric value moves. What remains is
4141
dominated by the parse rather than by the walk: a parse-only
4242
`bca dump` over the same files peaks at 25–70× the source size, which
43-
the CI recipe now states as the `--jobs` memory sizing rule.
43+
the CI recipe now records as the in-flight term in its `--jobs` sizing
44+
guidance — alongside the destinations that add a result-set term on
45+
top of it (`metrics --output <FILE>`, structured stdout).
4446

4547
### Changed
4648

big-code-analysis-book/src/recipes/ci.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,20 @@ Applies regardless of provider:
869869
macOS/Windows — so CI runners no longer need to thread
870870
`--jobs "$(nproc)"` through every recipe. `--jobs 1`
871871
remains a debugging knob, not a default. It is *not*
872-
memory-aware: each worker holds one whole file in memory at a
873-
time, and a parse-only run measures 25–70× the source size, so
874-
peak RSS is roughly `jobs × 70 × the largest source file` in
875-
the tree. A memory-limited container with many vCPUs should
876-
pass an explicit `--jobs`.
872+
memory-aware. Each worker holds one whole file at a time and a
873+
parse-only run measures 25–70× the source size, so the
874+
*in-flight* term is roughly `jobs × 70 × the largest source
875+
file` in the tree — and `--jobs` bounds that term only.
876+
Whether it is the whole story depends on the destination:
877+
`--output-dir` writes each document as it is produced and
878+
`bca check` reduces each file to its violations, so both stay
879+
at the in-flight bound, while `metrics --output <FILE>`
880+
collects every file's result and serializes it after the walk,
881+
and structured stdout holds finished documents while an
882+
earlier file is still being analyzed — which is worst when one
883+
large file sorts early. A memory-limited container with many
884+
vCPUs should pass an explicit `--jobs`, and prefer
885+
`--output-dir` to `--output <FILE>` on a large tree.
877886
- **Always pass `--strip-prefix "$PWD/"` to `bca report markdown`**
878887
so the path column is identical across runners with different
879888
workspace paths. Without it the diff between two reports is

0 commit comments

Comments
 (0)