import { type ParserOptions } from "../core/parser-engine.js"; /** * Benchmark configuration for parser throughput measurements. * * Boundary contract: * - This configuration only controls execution shape (iterations/chunking/parser mode). * - It must not mutate parser behavior beyond explicit `parserOptions`. */ export interface CesrParserBenchmarkOptions { /** Number of measured parser runs. */ iterations?: number; /** Number of warmup runs before measured runs. */ warmupIterations?: number; /** * Optional chunk size for simulated streaming. * * When unset or <= 0, the full stream is fed in one chunk. */ chunkSize?: number; /** Parser behavior options to benchmark. */ parserOptions?: ParserOptions; /** * Whether any parse error frame should fail the benchmark run. * Default: true. */ failOnParseError?: boolean; } /** Per-run frame/error counts used to aggregate benchmark totals. */ export interface CesrParseRunSummary { /** Count of successfully emitted frame events for one run. */ frameCount: number; /** Count of emitted parser error events for one run. */ errorCount: number; } /** * Stable benchmark result envelope consumed by CLI and maintainers. * * Invariants: * - `totalBytes === bytesPerIteration * iterations` * - rate metrics are derived from `elapsedMs` and must remain monotonic with work size. */ export interface CesrParserBenchmarkResult { iterations: number; warmupIterations: number; chunkSize: number; bytesPerIteration: number; totalBytes: number; totalFrames: number; totalErrors: number; elapsedMs: number; avgIterationMs: number; throughputBytesPerSec: number; throughputMiBPerSec: number; framesPerSec: number; } /** * Execute one complete parser pass over the provided stream. * * Boundary contract: * - Always feeds configured chunks and then flushes once. * - Returns event counts only; callers own timing and aggregation. */ export declare function parseCesrStreamOnce(input: Uint8Array, options?: Pick): CesrParseRunSummary; /** * Benchmark parser throughput across warmup + measured iterations. * * Invariants: * - warmup runs are excluded from final metrics. * - when `failOnParseError` is true, any parse error fails fast to prevent * silently benchmarking degraded correctness. */ export declare function benchmarkCesrParser(input: Uint8Array, options?: CesrParserBenchmarkOptions): CesrParserBenchmarkResult; //# sourceMappingURL=parser-benchmark.d.ts.map