/** * `uniq` over many rows holds the whole column in memory — say so before the run. * * A `` already warns at 100,000 members (TDC234), because it is built in * full before the first row. `uniq` on a sequence does exactly the same thing — * drawing without replacement means remembering what has been drawn — and said * nothing at all. Measured before this check existed: 1,600,000 rows peaked at * 453 MB, and the run gave no clue why. * * The asymmetry was the whole reason to add it. Two constructs with the same * cost, one of which announces itself and one of which does not, is the kind of * gap a reader cannot be expected to close on their own. * * ── Where it shows up ──────────────────────────────────────────────────────── * This is a VALIDATOR warning, which is what makes it useful. `tdcv2 check` * generates nothing and prints it instantly, so Studio can run check before a * run and warn while it is still free. On a real run it goes to stderr ahead of * the engine — measured at 341 ms against the first row at 1795 ms — so there is * time to stop, and stdout stays clean for a pipe either way. * * ── Where the number comes from ───────────────────────────────────────────── * MEASURED, not guessed: peak RSS against row count, three runs at each size, * smallest kept, every run checked for a zero exit and a full output file. * * 200,000 rows 154.5 MB 800,000 rows 305.6 MB * 400,000 rows 223.2 MB 1,600,000 rows 453.0 MB * * The SLOPE is what matters — everything that does not grow with rows (Node * itself, the pack loader, the output buffer) drops out of it. Over that * eight-fold range it holds between 193 and 224 bytes a value for integers; an * 11-character string column measured 257 on its clean stretch. 250 is the * round number that covers both, and the message says "about". * * A first attempt subtracted a baseline run without `uniq` and produced NEGATIVE * costs, because a config without `uniq` streams and one with it does not — the * subtraction was comparing two different engines. The slope needs no baseline. */ import type { Diagnostic } from '../errors/index.js'; import type { OpenCloseElementContext, SelfClosingElementContext } from '../generated/TDCParser.js'; /** * Warn when a sequence carrying `uniq="true"` will hold a large column. * * `count` is the run length, already parsed by the caller — a config whose count * did not parse has an error of its own and is not made clearer by this. */ export declare function checkUniqMemory(node: OpenCloseElementContext | SelfClosingElementContext, name: string, count: number, diagnostics: Diagnostic[]): void; //# sourceMappingURL=uniq-memory.d.ts.map