/** * GPU Benchmark Utilities * * Provides tools for measuring rendering performance across backends. */ export interface BenchmarkResult { backend: "webgpu" | "webgl" | "unknown"; pointCount: number; fps: number; avgFrameTime: number; minFrameTime: number; maxFrameTime: number; totalFrames: number; duration: number; } export interface BenchmarkOptions { /** Number of points to render */ pointCount?: number; /** Duration of benchmark in milliseconds */ durationMs?: number; /** Warm-up frames before measuring */ warmupFrames?: number; /** Callback for progress updates */ onProgress?: (progress: number) => void; } /** * Benchmark runner for GPU backends */ export declare class GpuBenchmark { private canvas; private results; constructor(canvas?: HTMLCanvasElement); /** * Generate random line data */ private generateLineData; /** * Measure frame times */ private measureFrameTimes; /** * Run benchmark with WebGPU backend */ benchmarkWebGPU(options?: BenchmarkOptions): Promise; /** * Run benchmark with WebGL backend */ benchmarkWebGL(options?: BenchmarkOptions): Promise; /** * Calculate benchmark result from frame times */ private calculateResult; /** * Run comparative benchmark */ runComparison(options?: BenchmarkOptions): Promise<{ webgpu: BenchmarkResult | null; webgl: BenchmarkResult | null; winner: "webgpu" | "webgl" | "tie" | "unknown"; speedup: number; }>; /** * Get all results */ getResults(): BenchmarkResult[]; /** * Clear results */ clearResults(): void; /** * Format result as string */ static formatResult(result: BenchmarkResult): string; }