export interface BenchmarkScenario { /** Unique scenario ID. */ id: string; /** Human-readable name. */ name: string; /** Category for grouping. */ category: 'ecs' | 'rendering' | 'physics' | 'scene' | 'general'; /** Setup — called once before the benchmark runs. Returns cleanup fn if needed. */ setup?: () => void | (() => void); /** The function to benchmark. Called repeatedly. */ run: () => void; /** Teardown — called after the benchmark finishes. */ teardown?: () => void; /** How many warm-up iterations before measuring. Default: 10 */ warmup?: number; /** How many measured iterations. Default: 100 */ iterations?: number; /** Expected max ms per iteration (for regression checks). */ budgetMs?: number; } export interface BenchmarkTimings { min: number; max: number; mean: number; median: number; p95: number; p99: number; stdDev: number; totalMs: number; iterations: number; } export interface BenchmarkMemory { heapUsedBefore: number; heapUsedAfter: number; heapDelta: number; } export interface BenchmarkResult { scenarioId: string; scenarioName: string; category: string; timings: BenchmarkTimings; memory: BenchmarkMemory | null; budgetMs: number | null; withinBudget: boolean | null; timestamp: number; } export interface BenchmarkReport { /** Engine version or label. */ label: string; /** ISO timestamp. */ date: string; /** Platform info. */ platform: string; /** All results. */ results: BenchmarkResult[]; /** Summary. */ summary: { totalScenarios: number; passed: number; failed: number; skipped: number; totalTimeMs: number; }; } export interface RegressionResult { scenarioId: string; scenarioName: string; /** Positive = slower (regression), negative = faster (improvement). */ meanDeltaPercent: number; p95DeltaPercent: number; /** Whether it exceeds the threshold. */ regressed: boolean; improved: boolean; } export declare class BenchmarkRunner { private scenarios; private results; /** Register a benchmark scenario. */ register(scenario: BenchmarkScenario): void; /** Register multiple scenarios. */ registerAll(scenarios: BenchmarkScenario[]): void; /** Run a single scenario. */ runScenario(id: string): BenchmarkResult | null; /** Run all registered scenarios. */ runAll(): BenchmarkReport; /** Run scenarios in a specific category. */ runCategory(category: BenchmarkScenario['category']): BenchmarkReport; /** Generate a full report from collected results. */ generateReport(label?: string): BenchmarkReport; /** Compare two reports for regressions. */ static compareReports(baseline: BenchmarkReport, current: BenchmarkReport, regressionThresholdPercent?: number): RegressionResult[]; /** Get last results. */ getResults(): BenchmarkResult[]; /** Clear all scenarios and results. */ clear(): void; private calculateTimings; private getHeapUsed; } export declare const BUILTIN_BENCHMARKS: BenchmarkScenario[];