/** * Fit the run into the machine's memory by choosing fewer workers. * * Every worker is a separate V8 isolate that re-reads and re-parses the config's * data files, so memory grows LINEARLY with the job count. Measured on a * 160 000-row surname CSV: 170 MB at one worker, 1057 MB at eight — while the * wall clock stayed at 0.6 s either way. Paying six times the memory for no * time at all is the worst kind of default. * * The decision is made silently. Someone generating test data may be an * analyst rather than an engineer, and telling them about isolates, cores and * heap growth helps nobody; the tool should simply not put itself in a position * where it dies halfway. Slower and finished beats faster and killed. * * Note that switching ENGINE does not help here. A large value list has to be * resident whatever the engine does with rows — measured at 172 MB for stream, * disk and memory alike. The only lever for list size is the worker count. */ import { type DataSourceOptions } from '../data-source/index.js'; /** Total on-disk size of every `src=` file the config reads. */ export declare function dataFileBytes(sources: readonly string[], options?: DataSourceOptions): number; /** Every `src="…"` in the source, in document order. Cheap textual scan. */ export declare function declaredSources(source: string): string[]; export interface JobBudget { /** Workers the machine can actually afford. */ readonly jobs: number; /** True when the request was reduced — the caller may mention it if asked explicitly. */ readonly reduced: boolean; } /** * Reduce a job count until the run fits in memory. * * Never returns 0: one worker always runs, because refusing outright would be * less useful than being slow. If even one worker looks too large, that is a * problem no job count can fix and the engine choice already handles the row * side of it. */ export declare function fitJobsToMemory(params: { readonly jobs: number; readonly dataBytes: number; readonly totalBytes?: number; }): JobBudget; //# sourceMappingURL=memory-budget.d.ts.map