콘텐츠로 이동

benchmark

benchmark(options): BenchmarkResult

Defined in: core/index.ts:2343

특정 phase 를 N 회 반복 실행하고 통계 (mean/median/p95/p99/stddev/min/max) 를 반환한다.

CLI zntc bench --phase=... 의 NAPI 대응 — 같은 engine 사용.

BenchmarkOptions

BenchmarkResult

import { init, benchmark } from "@zntc/core";
init();
const result = benchmark({
file: "./src/App.tsx",
phases: ["parse"],
iterations: 100,
});
console.log(result.phases.parse.mean_ms); // 42.3