benchforge 0.1.11 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +99 -294
- package/bin/benchforge +1 -2
- package/dist/AnalyzeArchive-8NCJhmhS.mjs +145 -0
- package/dist/AnalyzeArchive-8NCJhmhS.mjs.map +1 -0
- package/dist/BenchMatrix-BZVrBB_h.mjs +1050 -0
- package/dist/BenchMatrix-BZVrBB_h.mjs.map +1 -0
- package/dist/{BenchRunner-BzyUfiyB.d.mts → BenchRunner-DglX1NOn.d.mts} +119 -66
- package/dist/CoverageSampler-D5T9DRqe.mjs +27 -0
- package/dist/CoverageSampler-D5T9DRqe.mjs.map +1 -0
- package/dist/Formatters-BWj3d4sv.mjs +95 -0
- package/dist/Formatters-BWj3d4sv.mjs.map +1 -0
- package/dist/{HeapSampler-B8dtKHn1.mjs → HeapSampler-Dq-hpXem.mjs} +4 -4
- package/dist/HeapSampler-Dq-hpXem.mjs.map +1 -0
- package/dist/RunBenchCLI-C17DrJz8.mjs +3075 -0
- package/dist/RunBenchCLI-C17DrJz8.mjs.map +1 -0
- package/dist/StatisticalUtils-BD92crgM.mjs +255 -0
- package/dist/StatisticalUtils-BD92crgM.mjs.map +1 -0
- package/dist/TimeSampler-Ds8n7l2B.mjs +29 -0
- package/dist/TimeSampler-Ds8n7l2B.mjs.map +1 -0
- package/dist/ViewerServer-BJhdnxlN.mjs +639 -0
- package/dist/ViewerServer-BJhdnxlN.mjs.map +1 -0
- package/dist/ViewerServer-CuMNdNBz.mjs +2 -0
- package/dist/bin/benchforge.mjs +4 -5
- package/dist/bin/benchforge.mjs.map +1 -1
- package/dist/index.d.mts +711 -558
- package/dist/index.mjs +98 -3
- package/dist/index.mjs.map +1 -0
- package/dist/runners/WorkerScript.d.mts +12 -4
- package/dist/runners/WorkerScript.mjs +77 -105
- package/dist/runners/WorkerScript.mjs.map +1 -1
- package/dist/viewer/assets/CIPlot-BkOvMoMa.js +1 -0
- package/dist/viewer/assets/HistogramKde-CmSyUFY0.js +1 -0
- package/dist/viewer/assets/LegendUtils-BJpbn_jr.js +55 -0
- package/dist/viewer/assets/SampleTimeSeries-C4VBhXr3.js +1 -0
- package/dist/viewer/assets/index-Br9bp_cX.js +153 -0
- package/dist/viewer/assets/index-NzXXe_CC.css +1 -0
- package/dist/viewer/index.html +19 -0
- package/dist/viewer/speedscope/LICENSE +21 -0
- package/dist/viewer/speedscope/SourceCodePro-Regular.ttf-ILST5JV6.woff2 +0 -0
- package/dist/viewer/speedscope/favicon-16x16-V2DMIAZS.js +2 -0
- package/dist/viewer/speedscope/favicon-16x16-V2DMIAZS.js.map +7 -0
- package/dist/viewer/speedscope/favicon-16x16-VSI62OPJ.png +0 -0
- package/dist/viewer/speedscope/favicon-32x32-3EB2YCUY.png +0 -0
- package/dist/viewer/speedscope/favicon-32x32-THY3JDJL.js +2 -0
- package/dist/viewer/speedscope/favicon-32x32-THY3JDJL.js.map +7 -0
- package/dist/viewer/speedscope/favicon-FOKUP5Y5.ico +0 -0
- package/dist/viewer/speedscope/favicon-M34RF7BI.js +2 -0
- package/dist/viewer/speedscope/favicon-M34RF7BI.js.map +7 -0
- package/dist/viewer/speedscope/file-format-schema.json +274 -0
- package/dist/viewer/speedscope/index.html +19 -0
- package/dist/viewer/speedscope/jfrview_bg-BLJXNNQB.wasm +0 -0
- package/dist/viewer/speedscope/perf-vertx-stacks-01-collapsed-all-ZNUIGAJL.txt +199 -0
- package/dist/viewer/speedscope/release.txt +3 -0
- package/dist/viewer/speedscope/source-code-pro.LICENSE.md +93 -0
- package/dist/viewer/speedscope/speedscope-GHPHNKXC.css +2 -0
- package/dist/viewer/speedscope/speedscope-GHPHNKXC.css.map +7 -0
- package/dist/viewer/speedscope/speedscope-QZFMJ7VP.js +212 -0
- package/dist/viewer/speedscope/speedscope-QZFMJ7VP.js.map +7 -0
- package/package.json +52 -27
- package/src/bin/benchforge.ts +2 -2
- package/src/cli/AnalyzeArchive.ts +232 -0
- package/src/cli/BrowserBench.ts +322 -0
- package/src/cli/CliArgs.ts +164 -51
- package/src/cli/CliExport.ts +179 -0
- package/src/cli/CliOptions.ts +147 -0
- package/src/cli/CliReport.ts +197 -0
- package/src/cli/FilterBenchmarks.ts +18 -30
- package/src/cli/RunBenchCLI.ts +132 -866
- package/src/cli/SuiteRunner.ts +160 -0
- package/src/cli/ViewerServer.ts +282 -0
- package/src/export/AllocExport.ts +121 -0
- package/src/export/ArchiveExport.ts +146 -0
- package/src/export/ArchiveFormat.ts +50 -0
- package/src/export/CoverageExport.ts +148 -0
- package/src/export/EditorUri.ts +10 -0
- package/src/export/PerfettoExport.ts +64 -99
- package/src/export/SpeedscopeTypes.ts +98 -0
- package/src/export/TimeExport.ts +115 -0
- package/src/index.ts +86 -67
- package/src/matrix/BenchMatrix.ts +230 -0
- package/src/matrix/CaseLoader.ts +8 -6
- package/src/matrix/MatrixDirRunner.ts +153 -0
- package/src/matrix/MatrixFilter.ts +49 -47
- package/src/matrix/MatrixInlineRunner.ts +50 -0
- package/src/matrix/MatrixReport.ts +90 -250
- package/src/matrix/VariantLoader.ts +5 -5
- package/src/profiling/browser/BenchLoop.ts +51 -0
- package/src/profiling/browser/BrowserCDP.ts +133 -0
- package/src/profiling/browser/BrowserGcStats.ts +33 -0
- package/src/profiling/browser/BrowserProfiler.ts +160 -0
- package/src/profiling/browser/CdpClient.ts +82 -0
- package/src/profiling/browser/CdpPage.ts +138 -0
- package/src/profiling/browser/ChromeLauncher.ts +158 -0
- package/src/profiling/browser/ChromeTraceEvent.ts +28 -0
- package/src/profiling/browser/PageLoadMode.ts +61 -0
- package/src/profiling/node/CoverageSampler.ts +27 -0
- package/src/profiling/node/CoverageTypes.ts +23 -0
- package/src/profiling/node/HeapSampleReport.ts +261 -0
- package/src/{heap-sample → profiling/node}/HeapSampler.ts +1 -2
- package/src/{heap-sample → profiling/node}/ResolvedProfile.ts +18 -9
- package/src/profiling/node/TimeSampler.ts +57 -0
- package/src/report/BenchmarkReport.ts +146 -0
- package/src/report/Colors.ts +9 -0
- package/src/report/Formatters.ts +110 -0
- package/src/report/GcSections.ts +151 -0
- package/src/{GitUtils.ts → report/GitUtils.ts} +18 -19
- package/src/report/HtmlReport.ts +223 -0
- package/src/report/ParseStats.ts +73 -0
- package/src/report/StandardSections.ts +147 -0
- package/src/report/ViewerSections.ts +286 -0
- package/src/report/text/TableReport.ts +253 -0
- package/src/report/text/TextReport.ts +123 -0
- package/src/runners/AdaptiveWrapper.ts +116 -236
- package/src/runners/BenchRunner.ts +20 -15
- package/src/{Benchmark.ts → runners/BenchmarkSpec.ts} +5 -6
- package/src/runners/CreateRunner.ts +5 -7
- package/src/runners/GcStats.ts +47 -50
- package/src/{MeasuredResults.ts → runners/MeasuredResults.ts} +43 -37
- package/src/runners/MergeBatches.ts +123 -0
- package/src/{NodeGC.ts → runners/NodeGC.ts} +2 -3
- package/src/runners/RunnerOrchestrator.ts +127 -243
- package/src/runners/RunnerUtils.ts +75 -1
- package/src/runners/SampleStats.ts +100 -0
- package/src/runners/TimingRunner.ts +244 -0
- package/src/runners/TimingUtils.ts +3 -2
- package/src/runners/WorkerScript.ts +135 -151
- package/src/stats/BootstrapDifference.ts +282 -0
- package/src/{PermutationTest.ts → stats/PermutationTest.ts} +8 -17
- package/src/stats/StatisticalUtils.ts +445 -0
- package/src/{tests → test}/AdaptiveConvergence.test.ts +10 -10
- package/src/test/AdaptiveRunner.test.ts +39 -41
- package/src/{tests → test}/AdaptiveSampling.test.ts +9 -9
- package/src/test/AdaptiveStatistics.integration.ts +2 -2
- package/src/{tests → test}/BenchMatrix.test.ts +19 -16
- package/src/test/BenchmarkReport.test.ts +63 -13
- package/src/test/BrowserBench.e2e.test.ts +186 -17
- package/src/test/BrowserBench.test.ts +10 -5
- package/src/test/BuildTimeSection.test.ts +130 -0
- package/src/test/CapSamples.test.ts +82 -0
- package/src/test/CoverageExport.test.ts +115 -0
- package/src/test/CoverageSampler.test.ts +33 -0
- package/src/test/HeapAttribution.test.ts +14 -14
- package/src/{tests → test}/MatrixFilter.test.ts +1 -1
- package/src/{tests → test}/MatrixReport.test.ts +1 -1
- package/src/test/PermutationTest.test.ts +1 -1
- package/src/{tests → test}/RealDataValidation.test.ts +6 -6
- package/src/test/RunBenchCLI.test.ts +39 -38
- package/src/test/RunnerOrchestrator.test.ts +12 -12
- package/src/test/StatisticalUtils.test.ts +48 -12
- package/src/{table-util/test → test}/TableReport.test.ts +2 -2
- package/src/test/TestUtils.ts +12 -7
- package/src/test/TimeExport.test.ts +139 -0
- package/src/test/TimeSampler.test.ts +37 -0
- package/src/test/ViewerLive.e2e.test.ts +159 -0
- package/src/test/ViewerStatic.static.e2e.test.ts +137 -0
- package/src/{tests → test}/fixtures/baseline/impl.ts +1 -1
- package/src/{tests → test}/fixtures/bevy30-samples.ts +3 -1
- package/src/test/fixtures/cases/asyncCases.ts +9 -0
- package/src/{tests → test}/fixtures/cases/cases.ts +5 -2
- package/src/test/fixtures/cases/variants/product.ts +2 -0
- package/src/test/fixtures/cases/variants/sum.ts +2 -0
- package/src/test/fixtures/discover/fast.ts +1 -0
- package/src/{tests → test}/fixtures/discover/slow.ts +1 -1
- package/src/test/fixtures/invalid/bad.ts +1 -0
- package/src/test/fixtures/loader/fast.ts +1 -0
- package/src/{tests → test}/fixtures/loader/slow.ts +1 -1
- package/src/test/fixtures/loader/stateful.ts +2 -0
- package/src/test/fixtures/stateful/stateful.ts +2 -0
- package/src/test/fixtures/variants/extra.ts +1 -0
- package/src/test/fixtures/variants/impl.ts +1 -0
- package/src/test/fixtures/worker/fast.ts +1 -0
- package/src/{tests → test}/fixtures/worker/slow.ts +1 -1
- package/src/viewer/DateFormat.ts +30 -0
- package/src/viewer/Helpers.ts +23 -0
- package/src/viewer/LineData.ts +120 -0
- package/src/viewer/Providers.ts +191 -0
- package/src/viewer/ReportData.ts +123 -0
- package/src/viewer/State.ts +49 -0
- package/src/viewer/Theme.ts +15 -0
- package/src/viewer/components/App.tsx +73 -0
- package/src/viewer/components/DropZone.tsx +71 -0
- package/src/viewer/components/LazyPlot.ts +33 -0
- package/src/viewer/components/SamplesPanel.tsx +214 -0
- package/src/viewer/components/Shell.tsx +26 -0
- package/src/viewer/components/SourcePanel.tsx +216 -0
- package/src/viewer/components/SummaryPanel.tsx +332 -0
- package/src/viewer/components/TabBar.tsx +131 -0
- package/src/viewer/components/TabContent.tsx +46 -0
- package/src/viewer/components/ThemeToggle.tsx +50 -0
- package/src/viewer/index.html +20 -0
- package/src/viewer/main.tsx +4 -0
- package/src/viewer/plots/CIPlot.ts +313 -0
- package/src/{html/browser → viewer/plots}/HistogramKde.ts +33 -38
- package/src/viewer/plots/LegendUtils.ts +134 -0
- package/src/viewer/plots/PlotTypes.ts +85 -0
- package/src/viewer/plots/RenderPlots.ts +230 -0
- package/src/viewer/plots/SampleTimeSeries.ts +306 -0
- package/src/viewer/plots/SvgHelpers.ts +136 -0
- package/src/viewer/plots/TimeSeriesMarks.ts +319 -0
- package/src/viewer/report.css +427 -0
- package/src/viewer/shell.css +357 -0
- package/src/viewer/tsconfig.json +11 -0
- package/dist/BrowserHeapSampler-B6asLKWQ.mjs +0 -202
- package/dist/BrowserHeapSampler-B6asLKWQ.mjs.map +0 -1
- package/dist/GcStats-wX7Xyblu.mjs +0 -77
- package/dist/GcStats-wX7Xyblu.mjs.map +0 -1
- package/dist/HeapSampler-B8dtKHn1.mjs.map +0 -1
- package/dist/TimingUtils-DwOwkc8G.mjs +0 -597
- package/dist/TimingUtils-DwOwkc8G.mjs.map +0 -1
- package/dist/browser/index.js +0 -914
- package/dist/src-B-DDaCa9.mjs +0 -3108
- package/dist/src-B-DDaCa9.mjs.map +0 -1
- package/src/BenchMatrix.ts +0 -380
- package/src/BenchmarkReport.ts +0 -161
- package/src/HtmlDataPrep.ts +0 -148
- package/src/StandardSections.ts +0 -261
- package/src/StatisticalUtils.ts +0 -175
- package/src/TypeUtil.ts +0 -8
- package/src/browser/BrowserGcStats.ts +0 -44
- package/src/browser/BrowserHeapSampler.ts +0 -271
- package/src/export/JsonExport.ts +0 -103
- package/src/export/JsonFormat.ts +0 -91
- package/src/export/SpeedscopeExport.ts +0 -202
- package/src/heap-sample/HeapSampleReport.ts +0 -269
- package/src/html/HtmlReport.ts +0 -131
- package/src/html/HtmlTemplate.ts +0 -284
- package/src/html/Types.ts +0 -88
- package/src/html/browser/CIPlot.ts +0 -287
- package/src/html/browser/LegendUtils.ts +0 -163
- package/src/html/browser/RenderPlots.ts +0 -263
- package/src/html/browser/SampleTimeSeries.ts +0 -389
- package/src/html/browser/Types.ts +0 -96
- package/src/html/browser/index.ts +0 -1
- package/src/html/index.ts +0 -17
- package/src/runners/BasicRunner.ts +0 -364
- package/src/table-util/ConvergenceFormatters.ts +0 -19
- package/src/table-util/Formatters.ts +0 -157
- package/src/table-util/README.md +0 -70
- package/src/table-util/TableReport.ts +0 -293
- package/src/tests/fixtures/cases/asyncCases.ts +0 -7
- package/src/tests/fixtures/cases/variants/product.ts +0 -2
- package/src/tests/fixtures/cases/variants/sum.ts +0 -2
- package/src/tests/fixtures/discover/fast.ts +0 -1
- package/src/tests/fixtures/invalid/bad.ts +0 -1
- package/src/tests/fixtures/loader/fast.ts +0 -1
- package/src/tests/fixtures/loader/stateful.ts +0 -2
- package/src/tests/fixtures/stateful/stateful.ts +0 -2
- package/src/tests/fixtures/variants/extra.ts +0 -1
- package/src/tests/fixtures/variants/impl.ts +0 -1
- package/src/tests/fixtures/worker/fast.ts +0 -1
- /package/src/{table-util/test → test}/TableValueExtractor.test.ts +0 -0
- /package/src/{table-util/test → test}/TableValueExtractor.ts +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,248 +1,68 @@
|
|
|
1
|
-
import { a as MeasuredResults, i as BenchmarkSpec, n as BenchGroup, o as
|
|
2
|
-
import { Alignment } from "table";
|
|
1
|
+
import { a as MeasuredResults, c as HeapProfile, i as BenchmarkSpec, n as BenchGroup, o as PausePoint, r as BenchSuite, t as RunnerOptions } from "./BenchRunner-DglX1NOn.mjs";
|
|
3
2
|
import { Argv, InferredOptionTypes } from "yargs";
|
|
4
|
-
import
|
|
3
|
+
import { Alignment } from "table";
|
|
5
4
|
|
|
6
|
-
//#region src/BenchMatrix.d.ts
|
|
7
|
-
/** Stateless variant - called each iteration with case data */
|
|
8
|
-
type VariantFn<T = unknown> = (caseData: T) => void;
|
|
9
|
-
/** Stateful variant - setup once, run many */
|
|
10
|
-
interface StatefulVariant<T = unknown, S = unknown> {
|
|
11
|
-
setup: (caseData: T) => S | Promise<S>;
|
|
12
|
-
run: (state: S) => void;
|
|
13
|
-
}
|
|
14
|
-
/** A variant is either a plain function or a stateful setup+run pair */
|
|
15
|
-
type Variant<T = unknown, S = unknown> = VariantFn<T> | StatefulVariant<T, S>;
|
|
16
|
-
/** Variant with any state type - used in BenchMatrix to allow mixed variants */
|
|
17
|
-
type AnyVariant<T = unknown> = VariantFn<T> | StatefulVariant<T, any>;
|
|
18
|
-
/** Result from casesModule.loadCase() */
|
|
19
|
-
interface LoadedCase<T = unknown> {
|
|
20
|
-
data: T;
|
|
21
|
-
metadata?: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
interface MatrixDefaults {
|
|
24
|
-
warmup?: number;
|
|
25
|
-
maxTime?: number;
|
|
26
|
-
iterations?: number;
|
|
27
|
-
}
|
|
28
|
-
/** Bench matrix configuration */
|
|
29
|
-
interface BenchMatrix<T = unknown> {
|
|
30
|
-
name: string;
|
|
31
|
-
variantDir?: string;
|
|
32
|
-
variants?: Record<string, AnyVariant<T>>;
|
|
33
|
-
cases?: string[];
|
|
34
|
-
casesModule?: string;
|
|
35
|
-
baselineDir?: string;
|
|
36
|
-
baselineVariant?: string;
|
|
37
|
-
defaults?: MatrixDefaults;
|
|
38
|
-
}
|
|
39
|
-
/** Collection of matrices */
|
|
40
|
-
interface MatrixSuite {
|
|
41
|
-
name: string;
|
|
42
|
-
matrices: BenchMatrix<any>[];
|
|
43
|
-
}
|
|
44
|
-
/** Results for a single variant across all cases */
|
|
45
|
-
interface VariantResult {
|
|
46
|
-
id: string;
|
|
47
|
-
cases: CaseResult[];
|
|
48
|
-
}
|
|
49
|
-
/** Results for a single (variant, case) pair */
|
|
50
|
-
interface CaseResult {
|
|
51
|
-
caseId: string;
|
|
52
|
-
measured: MeasuredResults;
|
|
53
|
-
metadata?: Record<string, unknown>;
|
|
54
|
-
baseline?: MeasuredResults;
|
|
55
|
-
deltaPercent?: number;
|
|
56
|
-
}
|
|
57
|
-
/** Results from running a matrix */
|
|
58
|
-
interface MatrixResults {
|
|
59
|
-
name: string;
|
|
60
|
-
variants: VariantResult[];
|
|
61
|
-
}
|
|
62
|
-
/** Options for runMatrix */
|
|
63
|
-
interface RunMatrixOptions {
|
|
64
|
-
iterations?: number;
|
|
65
|
-
maxTime?: number;
|
|
66
|
-
warmup?: number;
|
|
67
|
-
useWorker?: boolean;
|
|
68
|
-
filteredCases?: string[];
|
|
69
|
-
filteredVariants?: string[];
|
|
70
|
-
collect?: boolean;
|
|
71
|
-
cpuCounters?: boolean;
|
|
72
|
-
traceOpt?: boolean;
|
|
73
|
-
noSettle?: boolean;
|
|
74
|
-
pauseFirst?: number;
|
|
75
|
-
pauseInterval?: number;
|
|
76
|
-
pauseDuration?: number;
|
|
77
|
-
gcStats?: boolean;
|
|
78
|
-
heapSample?: boolean;
|
|
79
|
-
heapInterval?: number;
|
|
80
|
-
heapDepth?: number;
|
|
81
|
-
}
|
|
82
|
-
/** @return true if variant is a StatefulVariant (has setup + run) */
|
|
83
|
-
declare function isStatefulVariant<T, S>(v: Variant<T, S>): v is StatefulVariant<T, S>;
|
|
84
|
-
/** Run a BenchMatrix with inline variants or variantDir */
|
|
85
|
-
declare function runMatrix<T>(matrix: BenchMatrix<T>, options?: RunMatrixOptions): Promise<MatrixResults>;
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/table-util/TableReport.d.ts
|
|
88
|
-
type AnyColumn<T> = Column<T> | DiffColumn<T>;
|
|
89
|
-
/** Column with optional formatter */
|
|
90
|
-
interface Column<T> extends ColumnFormat<T> {
|
|
91
|
-
formatter?: (value: unknown) => string | null;
|
|
92
|
-
diffKey?: undefined;
|
|
93
|
-
}
|
|
94
|
-
/** Comparison column against baseline */
|
|
95
|
-
interface DiffColumn<T> extends ColumnFormat<T> {
|
|
96
|
-
diffFormatter?: (value: unknown, baseline: unknown) => string | null;
|
|
97
|
-
formatter?: undefined;
|
|
98
|
-
/** Key for comparison value against baseline */
|
|
99
|
-
diffKey: keyof T;
|
|
100
|
-
}
|
|
101
|
-
interface ColumnFormat<T> {
|
|
102
|
-
key: keyof T;
|
|
103
|
-
title: string;
|
|
104
|
-
alignment?: Alignment;
|
|
105
|
-
width?: number;
|
|
106
|
-
}
|
|
107
|
-
/** Build formatted table with column groups and baselines */
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/BenchmarkReport.d.ts
|
|
110
|
-
/** Benchmark results with optional baseline for comparison */
|
|
111
|
-
interface ReportGroup {
|
|
112
|
-
name: string;
|
|
113
|
-
reports: BenchmarkReport[];
|
|
114
|
-
baseline?: BenchmarkReport;
|
|
115
|
-
}
|
|
116
|
-
/** Results from a single benchmark run */
|
|
117
|
-
interface BenchmarkReport {
|
|
118
|
-
name: string;
|
|
119
|
-
measuredResults: MeasuredResults;
|
|
120
|
-
metadata?: UnknownRecord;
|
|
121
|
-
}
|
|
122
|
-
interface ReportColumnGroup<T> {
|
|
123
|
-
groupTitle?: string;
|
|
124
|
-
columns: ReportColumn<T>[];
|
|
125
|
-
}
|
|
126
|
-
type ReportColumn<T> = AnyColumn<T> & {
|
|
127
|
-
/** Add diff column after this column when baseline exists */comparable?: boolean; /** Set true for throughput metrics where higher values are better (e.g., lines/sec) */
|
|
128
|
-
higherIsBetter?: boolean;
|
|
129
|
-
};
|
|
130
|
-
/** Maps benchmark results to table columns */
|
|
131
|
-
interface ResultsMapper<T extends Record<string, any> = Record<string, any>> {
|
|
132
|
-
extract(results: MeasuredResults, metadata?: UnknownRecord): T;
|
|
133
|
-
columns(): ReportColumnGroup<T>[];
|
|
134
|
-
}
|
|
135
|
-
type UnknownRecord = Record<string, unknown>;
|
|
136
|
-
/** @return formatted table report with optional baseline comparisons */
|
|
137
|
-
declare function reportResults<S extends ReadonlyArray<ResultsMapper<any>>>(groups: ReportGroup[], sections: S): string;
|
|
138
|
-
//#endregion
|
|
139
5
|
//#region src/cli/CliArgs.d.ts
|
|
140
6
|
type Configure<T> = (yargs: Argv) => Argv<T>;
|
|
141
|
-
/** CLI args type inferred from cliOptions, plus optional file positional */
|
|
7
|
+
/** CLI args type inferred from cliOptions, plus optional file positional. */
|
|
142
8
|
type DefaultCliArgs = InferredOptionTypes<typeof cliOptions> & {
|
|
143
9
|
file?: string;
|
|
144
10
|
};
|
|
145
11
|
declare const cliOptions: {
|
|
146
|
-
readonly
|
|
12
|
+
readonly duration: {
|
|
147
13
|
readonly type: "number";
|
|
148
|
-
readonly default: 0.642;
|
|
149
14
|
readonly requiresArg: true;
|
|
150
|
-
readonly describe: "
|
|
15
|
+
readonly describe: "duration per batch in seconds (default: 0.642)";
|
|
151
16
|
};
|
|
152
|
-
readonly
|
|
153
|
-
readonly type: "
|
|
154
|
-
readonly
|
|
155
|
-
readonly describe: "
|
|
156
|
-
};
|
|
157
|
-
readonly collect: {
|
|
158
|
-
readonly type: "boolean";
|
|
159
|
-
readonly default: false;
|
|
160
|
-
readonly describe: "force GC after each iteration";
|
|
161
|
-
};
|
|
162
|
-
readonly "gc-stats": {
|
|
163
|
-
readonly type: "boolean";
|
|
164
|
-
readonly default: false;
|
|
165
|
-
readonly describe: "collect GC statistics (Node: --trace-gc-nvp, browser: CDP tracing)";
|
|
17
|
+
readonly iterations: {
|
|
18
|
+
readonly type: "number";
|
|
19
|
+
readonly requiresArg: true;
|
|
20
|
+
readonly describe: "iterations per batch (page loads for page-load mode, inner loop for bench)";
|
|
166
21
|
};
|
|
167
|
-
readonly
|
|
168
|
-
readonly type: "
|
|
169
|
-
readonly default:
|
|
170
|
-
readonly describe: "
|
|
22
|
+
readonly warmup: {
|
|
23
|
+
readonly type: "number";
|
|
24
|
+
readonly default: 0;
|
|
25
|
+
readonly describe: "warmup iterations before measurement";
|
|
171
26
|
};
|
|
172
27
|
readonly filter: {
|
|
173
28
|
readonly type: "string";
|
|
174
29
|
readonly requiresArg: true;
|
|
175
|
-
readonly describe: "filter
|
|
30
|
+
readonly describe: "filter by name/regex. Matrix: case/variant, case/, /variant";
|
|
176
31
|
};
|
|
177
32
|
readonly all: {
|
|
178
33
|
readonly type: "boolean";
|
|
179
34
|
readonly default: false;
|
|
180
35
|
readonly describe: "run all cases (ignore defaultCases)";
|
|
181
36
|
};
|
|
37
|
+
readonly list: {
|
|
38
|
+
readonly type: "boolean";
|
|
39
|
+
readonly default: false;
|
|
40
|
+
readonly describe: "list available benchmarks (or matrix cases/variants)";
|
|
41
|
+
};
|
|
182
42
|
readonly worker: {
|
|
183
43
|
readonly type: "boolean";
|
|
184
44
|
readonly default: true;
|
|
185
45
|
readonly describe: "run in worker process for isolation (default: true)";
|
|
186
46
|
};
|
|
187
|
-
readonly
|
|
188
|
-
readonly type: "boolean";
|
|
189
|
-
readonly default: false;
|
|
190
|
-
readonly describe: "adaptive sampling (experimental)";
|
|
191
|
-
};
|
|
192
|
-
readonly "min-time": {
|
|
47
|
+
readonly batches: {
|
|
193
48
|
readonly type: "number";
|
|
194
49
|
readonly default: 1;
|
|
195
|
-
readonly describe: "
|
|
196
|
-
};
|
|
197
|
-
readonly convergence: {
|
|
198
|
-
readonly type: "number";
|
|
199
|
-
readonly default: 95;
|
|
200
|
-
readonly describe: "adaptive confidence threshold (0-100)";
|
|
201
|
-
};
|
|
202
|
-
readonly warmup: {
|
|
203
|
-
readonly type: "number";
|
|
204
|
-
readonly default: 0;
|
|
205
|
-
readonly describe: "warmup iterations before measurement";
|
|
206
|
-
};
|
|
207
|
-
readonly html: {
|
|
208
|
-
readonly type: "boolean";
|
|
209
|
-
readonly default: false;
|
|
210
|
-
readonly describe: "generate HTML report and open in browser";
|
|
211
|
-
};
|
|
212
|
-
readonly "export-html": {
|
|
213
|
-
readonly type: "string";
|
|
214
|
-
readonly requiresArg: true;
|
|
215
|
-
readonly describe: "export HTML report to specified file";
|
|
216
|
-
};
|
|
217
|
-
readonly json: {
|
|
218
|
-
readonly type: "string";
|
|
219
|
-
readonly requiresArg: true;
|
|
220
|
-
readonly describe: "export benchmark data to JSON file";
|
|
221
|
-
};
|
|
222
|
-
readonly "export-perfetto": {
|
|
223
|
-
readonly type: "string";
|
|
224
|
-
readonly requiresArg: true;
|
|
225
|
-
readonly describe: "export Perfetto trace file (view at ui.perfetto.dev)";
|
|
50
|
+
readonly describe: "divide time into N batches, alternating baseline/current order";
|
|
226
51
|
};
|
|
227
|
-
readonly
|
|
52
|
+
readonly "warmup-batch": {
|
|
228
53
|
readonly type: "boolean";
|
|
229
54
|
readonly default: false;
|
|
230
|
-
readonly describe: "
|
|
231
|
-
};
|
|
232
|
-
readonly "export-speedscope": {
|
|
233
|
-
readonly type: "string";
|
|
234
|
-
readonly requiresArg: true;
|
|
235
|
-
readonly describe: "export heap profile as speedscope JSON";
|
|
55
|
+
readonly describe: "include first batch in results (normally dropped to avoid OS cache warmup)";
|
|
236
56
|
};
|
|
237
|
-
readonly "
|
|
238
|
-
readonly type: "
|
|
239
|
-
readonly default:
|
|
240
|
-
readonly describe: "
|
|
57
|
+
readonly "equiv-margin": {
|
|
58
|
+
readonly type: "number";
|
|
59
|
+
readonly default: 2;
|
|
60
|
+
readonly describe: "equivalence margin % for baseline comparison (0 to disable)";
|
|
241
61
|
};
|
|
242
|
-
readonly "
|
|
62
|
+
readonly "no-batch-trim": {
|
|
243
63
|
readonly type: "boolean";
|
|
244
64
|
readonly default: false;
|
|
245
|
-
readonly describe: "
|
|
65
|
+
readonly describe: "disable Tukey trimming of outlier batches";
|
|
246
66
|
};
|
|
247
67
|
readonly "pause-first": {
|
|
248
68
|
readonly type: "number";
|
|
@@ -258,71 +78,180 @@ declare const cliOptions: {
|
|
|
258
78
|
readonly default: 100;
|
|
259
79
|
readonly describe: "pause duration in ms for V8 optimization";
|
|
260
80
|
};
|
|
261
|
-
readonly
|
|
81
|
+
readonly "gc-stats": {
|
|
82
|
+
readonly type: "boolean";
|
|
83
|
+
readonly default: false;
|
|
84
|
+
readonly describe: "collect GC statistics (Node: --trace-gc-nvp, browser: CDP tracing)";
|
|
85
|
+
};
|
|
86
|
+
readonly "gc-force": {
|
|
87
|
+
readonly type: "boolean";
|
|
88
|
+
readonly default: false;
|
|
89
|
+
readonly describe: "force GC after each iteration";
|
|
90
|
+
};
|
|
91
|
+
readonly adaptive: {
|
|
92
|
+
readonly type: "boolean";
|
|
93
|
+
readonly default: false;
|
|
94
|
+
readonly describe: "adaptive sampling (experimental)";
|
|
95
|
+
};
|
|
96
|
+
readonly "min-time": {
|
|
262
97
|
readonly type: "number";
|
|
263
98
|
readonly default: 1;
|
|
264
|
-
readonly describe: "
|
|
99
|
+
readonly describe: "minimum time before adaptive convergence can stop";
|
|
265
100
|
};
|
|
266
|
-
readonly
|
|
101
|
+
readonly convergence: {
|
|
267
102
|
readonly type: "number";
|
|
268
|
-
readonly
|
|
269
|
-
readonly describe: "
|
|
103
|
+
readonly default: 95;
|
|
104
|
+
readonly describe: "adaptive confidence threshold (0-100)";
|
|
270
105
|
};
|
|
271
|
-
readonly
|
|
106
|
+
readonly alloc: {
|
|
272
107
|
readonly type: "boolean";
|
|
273
108
|
readonly default: false;
|
|
274
|
-
readonly describe: "
|
|
109
|
+
readonly describe: "allocation sampling attribution (includes garbage)";
|
|
275
110
|
};
|
|
276
|
-
readonly "
|
|
111
|
+
readonly "alloc-interval": {
|
|
277
112
|
readonly type: "number";
|
|
278
113
|
readonly default: 32768;
|
|
279
|
-
readonly describe: "
|
|
114
|
+
readonly describe: "allocation sampling interval in bytes";
|
|
280
115
|
};
|
|
281
|
-
readonly "
|
|
116
|
+
readonly "alloc-depth": {
|
|
282
117
|
readonly type: "number";
|
|
283
118
|
readonly default: 64;
|
|
284
|
-
readonly describe: "
|
|
119
|
+
readonly describe: "allocation sampling stack depth";
|
|
285
120
|
};
|
|
286
|
-
readonly "
|
|
121
|
+
readonly "alloc-rows": {
|
|
287
122
|
readonly type: "number";
|
|
288
123
|
readonly default: 20;
|
|
289
124
|
readonly describe: "top allocation sites to show";
|
|
290
125
|
};
|
|
291
|
-
readonly "
|
|
126
|
+
readonly "alloc-stack": {
|
|
292
127
|
readonly type: "number";
|
|
293
128
|
readonly default: 3;
|
|
294
129
|
readonly describe: "call stack depth to display";
|
|
295
130
|
};
|
|
296
|
-
readonly "
|
|
131
|
+
readonly "alloc-verbose": {
|
|
297
132
|
readonly type: "boolean";
|
|
298
133
|
readonly default: false;
|
|
299
134
|
readonly describe: "verbose output with file:// paths and line numbers";
|
|
300
135
|
};
|
|
301
|
-
readonly "
|
|
136
|
+
readonly "alloc-raw": {
|
|
302
137
|
readonly type: "boolean";
|
|
303
138
|
readonly default: false;
|
|
304
|
-
readonly describe: "dump every raw
|
|
139
|
+
readonly describe: "dump every raw allocation sample (ordinal, size, stack)";
|
|
305
140
|
};
|
|
306
|
-
readonly "
|
|
141
|
+
readonly "alloc-user-only": {
|
|
307
142
|
readonly type: "boolean";
|
|
308
143
|
readonly default: false;
|
|
309
144
|
readonly describe: "filter to user code only (hide node internals)";
|
|
310
145
|
};
|
|
146
|
+
readonly profile: {
|
|
147
|
+
readonly type: "boolean";
|
|
148
|
+
readonly default: false;
|
|
149
|
+
readonly alias: "time-sample";
|
|
150
|
+
readonly describe: "V8 CPU time sampling profiler";
|
|
151
|
+
};
|
|
152
|
+
readonly "profile-interval": {
|
|
153
|
+
readonly type: "number";
|
|
154
|
+
readonly default: 1000;
|
|
155
|
+
readonly alias: "time-interval";
|
|
156
|
+
readonly describe: "CPU sampling interval in microseconds";
|
|
157
|
+
};
|
|
158
|
+
readonly "call-counts": {
|
|
159
|
+
readonly type: "boolean";
|
|
160
|
+
readonly default: false;
|
|
161
|
+
readonly describe: "collect per-function execution counts via V8 precise coverage";
|
|
162
|
+
};
|
|
163
|
+
readonly stats: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly default: "mean,p50,p99";
|
|
166
|
+
readonly describe: "timing columns: mean|median|min|max|p<N> (e.g. mean,p70,p99)";
|
|
167
|
+
};
|
|
168
|
+
readonly view: {
|
|
169
|
+
readonly type: "boolean";
|
|
170
|
+
readonly default: false;
|
|
171
|
+
readonly alias: "html";
|
|
172
|
+
readonly describe: "open viewer in browser";
|
|
173
|
+
};
|
|
174
|
+
readonly "view-serve": {
|
|
175
|
+
readonly type: "boolean";
|
|
176
|
+
readonly default: false;
|
|
177
|
+
readonly describe: "start viewer server without opening browser (reload an existing tab)";
|
|
178
|
+
};
|
|
179
|
+
readonly "export-perfetto": {
|
|
180
|
+
readonly type: "string";
|
|
181
|
+
readonly requiresArg: true;
|
|
182
|
+
readonly describe: "export Perfetto trace file (view at ui.perfetto.dev)";
|
|
183
|
+
};
|
|
184
|
+
readonly "export-profile": {
|
|
185
|
+
readonly type: "string";
|
|
186
|
+
readonly requiresArg: true;
|
|
187
|
+
readonly alias: "export-time";
|
|
188
|
+
readonly describe: "export CPU profile as .cpuprofile (V8/Chrome DevTools format)";
|
|
189
|
+
};
|
|
190
|
+
readonly archive: {
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
readonly describe: "archive profile + sources to .benchforge file";
|
|
193
|
+
};
|
|
194
|
+
readonly editor: {
|
|
195
|
+
readonly type: "string";
|
|
196
|
+
readonly default: "vscode";
|
|
197
|
+
readonly describe: "editor for source links: vscode, cursor, or custom://scheme";
|
|
198
|
+
};
|
|
199
|
+
readonly inspect: {
|
|
200
|
+
readonly type: "boolean";
|
|
201
|
+
readonly default: false;
|
|
202
|
+
readonly describe: "run once for external profiler attach";
|
|
203
|
+
};
|
|
204
|
+
readonly "trace-opt": {
|
|
205
|
+
readonly type: "boolean";
|
|
206
|
+
readonly default: false;
|
|
207
|
+
readonly describe: "trace V8 optimization tiers (requires --allow-natives-syntax)";
|
|
208
|
+
};
|
|
209
|
+
readonly "pause-warmup": {
|
|
210
|
+
readonly type: "number";
|
|
211
|
+
readonly default: 0;
|
|
212
|
+
readonly requiresArg: true;
|
|
213
|
+
readonly describe: "post-warmup settle time in ms for V8 background compilation (0 to skip)";
|
|
214
|
+
};
|
|
311
215
|
readonly url: {
|
|
312
216
|
readonly type: "string";
|
|
313
217
|
readonly requiresArg: true;
|
|
314
218
|
readonly describe: "page URL for browser profiling (enables browser mode)";
|
|
315
219
|
};
|
|
220
|
+
readonly "page-load": {
|
|
221
|
+
readonly type: "boolean";
|
|
222
|
+
readonly default: false;
|
|
223
|
+
readonly describe: "passive page-load profiling (no __bench needed)";
|
|
224
|
+
};
|
|
225
|
+
readonly "wait-for": {
|
|
226
|
+
readonly type: "string";
|
|
227
|
+
readonly requiresArg: true;
|
|
228
|
+
readonly describe: "page-load completion: CSS selector, JS expression, 'load', or 'domcontentloaded'";
|
|
229
|
+
};
|
|
316
230
|
readonly headless: {
|
|
317
231
|
readonly type: "boolean";
|
|
318
|
-
readonly default:
|
|
319
|
-
readonly describe: "run browser in headless mode";
|
|
232
|
+
readonly default: false;
|
|
233
|
+
readonly describe: "run browser in headless mode (default: headed)";
|
|
320
234
|
};
|
|
321
235
|
readonly timeout: {
|
|
322
236
|
readonly type: "number";
|
|
323
237
|
readonly default: 60;
|
|
324
238
|
readonly describe: "browser page timeout in seconds";
|
|
325
239
|
};
|
|
240
|
+
readonly chrome: {
|
|
241
|
+
readonly type: "string";
|
|
242
|
+
readonly requiresArg: true;
|
|
243
|
+
readonly describe: "Chrome binary path (default: auto-detect or CHROME_PATH)";
|
|
244
|
+
};
|
|
245
|
+
readonly "chrome-profile": {
|
|
246
|
+
readonly type: "string";
|
|
247
|
+
readonly requiresArg: true;
|
|
248
|
+
readonly describe: "Chrome user profile directory (default: temp profile)";
|
|
249
|
+
};
|
|
250
|
+
readonly "baseline-url": {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
readonly requiresArg: true;
|
|
253
|
+
readonly describe: "baseline URL for A/B comparison (fresh tab per batch)";
|
|
254
|
+
};
|
|
326
255
|
readonly "chrome-args": {
|
|
327
256
|
readonly type: "string";
|
|
328
257
|
readonly array: true;
|
|
@@ -330,103 +259,131 @@ declare const cliOptions: {
|
|
|
330
259
|
readonly describe: "extra Chromium flags";
|
|
331
260
|
};
|
|
332
261
|
};
|
|
333
|
-
/**
|
|
334
|
-
declare function defaultCliArgs(yargsInstance: Argv): Argv<DefaultCliArgs>;
|
|
335
|
-
/** @return parsed command line arguments */
|
|
262
|
+
/** Parse command line arguments with optional custom yargs configuration. */
|
|
336
263
|
declare function parseCliArgs<T = DefaultCliArgs>(args: string[], configure?: Configure<T>): T;
|
|
264
|
+
/** Configure yargs for browser benchmarking with url as a required positional. */
|
|
265
|
+
declare function browserCliArgs(yargsInstance: Argv): Argv<DefaultCliArgs>;
|
|
266
|
+
/** Configure yargs with standard benchmark options and file positional. */
|
|
267
|
+
declare function defaultCliArgs(yargsInstance: Argv): Argv<DefaultCliArgs>;
|
|
337
268
|
//#endregion
|
|
338
|
-
//#region src/
|
|
339
|
-
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
currentVersion?: GitVersion;
|
|
348
|
-
baselineVersion?: GitVersion;
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
interface GroupData {
|
|
352
|
-
name: string;
|
|
353
|
-
baseline?: BenchmarkData;
|
|
354
|
-
benchmarks: BenchmarkData[];
|
|
355
|
-
}
|
|
356
|
-
interface BenchmarkData {
|
|
357
|
-
name: string;
|
|
358
|
-
samples: number[];
|
|
359
|
-
warmupSamples?: number[];
|
|
360
|
-
allocationSamples?: number[];
|
|
361
|
-
heapSamples?: number[];
|
|
362
|
-
gcEvents?: GcEvent[];
|
|
363
|
-
optSamples?: number[];
|
|
364
|
-
pausePoints?: PausePoint[];
|
|
365
|
-
stats: {
|
|
366
|
-
min: number;
|
|
367
|
-
max: number;
|
|
368
|
-
avg: number;
|
|
369
|
-
p50: number;
|
|
370
|
-
p75: number;
|
|
371
|
-
p99: number;
|
|
372
|
-
p999: number;
|
|
373
|
-
};
|
|
374
|
-
heapSize?: {
|
|
375
|
-
min: number;
|
|
376
|
-
max: number;
|
|
377
|
-
avg: number;
|
|
378
|
-
};
|
|
379
|
-
sectionStats?: FormattedStat[];
|
|
380
|
-
comparisonCI?: DifferenceCI;
|
|
381
|
-
}
|
|
382
|
-
interface FormattedStat {
|
|
383
|
-
label: string;
|
|
384
|
-
value: string;
|
|
385
|
-
groupTitle?: string;
|
|
386
|
-
}
|
|
387
|
-
interface GcEvent {
|
|
388
|
-
offset: number;
|
|
389
|
-
duration: number;
|
|
390
|
-
}
|
|
391
|
-
interface PausePoint {
|
|
392
|
-
sampleIndex: number;
|
|
393
|
-
durationMs: number;
|
|
394
|
-
}
|
|
395
|
-
interface GitVersion {
|
|
396
|
-
hash: string;
|
|
397
|
-
date: string;
|
|
398
|
-
dirty?: boolean;
|
|
399
|
-
}
|
|
400
|
-
type CIDirection = "faster" | "slower" | "uncertain";
|
|
269
|
+
//#region src/stats/StatisticalUtils.d.ts
|
|
270
|
+
/** Whether CI was computed from block-level or sample-level resampling */
|
|
271
|
+
type CILevel = "block" | "sample";
|
|
272
|
+
/** Stat descriptor for multi-bootstrap: known stat kinds enable zero-alloc inner loops */
|
|
273
|
+
type StatKind = "mean" | "min" | "max" | {
|
|
274
|
+
percentile: number;
|
|
275
|
+
};
|
|
276
|
+
type CIDirection = "faster" | "slower" | "uncertain" | "equivalent";
|
|
277
|
+
/** Binned histogram for efficient transfer to browser */
|
|
401
278
|
interface HistogramBin {
|
|
279
|
+
/** Bin center value */
|
|
402
280
|
x: number;
|
|
403
281
|
count: number;
|
|
404
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Bootstrap confidence interval for percentage difference between two sample medians.
|
|
285
|
+
* Used for baseline comparisons: negative percent means current is faster.
|
|
286
|
+
*/
|
|
405
287
|
interface DifferenceCI {
|
|
288
|
+
/** Observed percentage difference (current - baseline) / baseline */
|
|
406
289
|
percent: number;
|
|
290
|
+
/** Confidence interval [lower, upper] in percent */
|
|
407
291
|
ci: [number, number];
|
|
292
|
+
/** Whether the CI excludes zero: "faster", "slower", or "uncertain" */
|
|
408
293
|
direction: CIDirection;
|
|
294
|
+
/** Bootstrap distribution histogram for visualization */
|
|
409
295
|
histogram?: HistogramBin[];
|
|
296
|
+
/** Label for the CI plot title (e.g. "mean Δ%") */
|
|
297
|
+
label?: string;
|
|
298
|
+
/** Blocks trimmed per side [baseline, current] via Tukey fences */
|
|
299
|
+
trimmed?: [number, number];
|
|
300
|
+
/** Block-level (between-run) or sample-level (within-run) resampling */
|
|
301
|
+
ciLevel?: CILevel;
|
|
302
|
+
/** false when batch count is too low for reliable CI */
|
|
303
|
+
ciReliable?: boolean;
|
|
304
|
+
/** Original sample count before subsampling (set only when cap applied) */
|
|
305
|
+
subsampled?: number;
|
|
306
|
+
}
|
|
307
|
+
declare const maxBootstrapInput = 1e4;
|
|
308
|
+
/** Compute a statistic from samples by kind */
|
|
309
|
+
declare function computeStat(samples: number[], kind: StatKind): number;
|
|
310
|
+
/** @return true if the stat kind supports bootstrap CI (min/max don't) */
|
|
311
|
+
declare function isBootstrappable(kind: StatKind): boolean;
|
|
312
|
+
/** @return mean of values */
|
|
313
|
+
declare function average(values: number[]): number;
|
|
314
|
+
/** @return median (50th percentile) of values */
|
|
315
|
+
declare function median(values: number[]): number;
|
|
316
|
+
/** @return value at percentile p (0-1), using O(N) quickselect */
|
|
317
|
+
declare function percentile(values: number[], p: number): number;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/report/text/TableReport.d.ts
|
|
320
|
+
type AnyColumn<T> = Column<T> | DiffColumn<T>;
|
|
321
|
+
/** Table column with a value formatter (non-diff). */
|
|
322
|
+
interface Column<T> extends ColumnFormat<T> {
|
|
323
|
+
formatter?: (value: unknown) => string | null;
|
|
324
|
+
diffKey?: undefined;
|
|
410
325
|
}
|
|
411
|
-
interface
|
|
412
|
-
|
|
413
|
-
|
|
326
|
+
interface DiffColumn<T> extends ColumnFormat<T> {
|
|
327
|
+
diffFormatter?: (value: unknown, baseline: unknown) => string | null;
|
|
328
|
+
formatter?: undefined;
|
|
329
|
+
diffKey: keyof T;
|
|
414
330
|
}
|
|
415
|
-
interface
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
331
|
+
interface ColumnFormat<T> {
|
|
332
|
+
key: keyof T;
|
|
333
|
+
title: string;
|
|
334
|
+
alignment?: Alignment;
|
|
335
|
+
width?: number;
|
|
419
336
|
}
|
|
337
|
+
/** Build formatted table with column groups and baseline diffs. */
|
|
420
338
|
//#endregion
|
|
421
|
-
//#region src/
|
|
422
|
-
/**
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
|
|
339
|
+
//#region src/report/BenchmarkReport.d.ts
|
|
340
|
+
/** Options that affect baseline comparison statistics */
|
|
341
|
+
interface ComparisonOptions {
|
|
342
|
+
/** Equivalence margin in percent (0 to disable) */
|
|
343
|
+
equivMargin?: number;
|
|
344
|
+
/** Disable Tukey trimming of outlier batches */
|
|
345
|
+
noBatchTrim?: boolean;
|
|
346
|
+
}
|
|
347
|
+
/** Benchmark results with optional baseline for comparison */
|
|
348
|
+
interface ReportGroup {
|
|
349
|
+
name: string;
|
|
350
|
+
reports: BenchmarkReport[];
|
|
351
|
+
baseline?: BenchmarkReport;
|
|
352
|
+
}
|
|
353
|
+
/** Results from a single benchmark run */
|
|
354
|
+
interface BenchmarkReport {
|
|
355
|
+
name: string;
|
|
356
|
+
measuredResults: MeasuredResults;
|
|
357
|
+
metadata?: UnknownRecord;
|
|
358
|
+
}
|
|
359
|
+
/** A titled group of related columns (one per report section) */
|
|
360
|
+
interface ReportSection {
|
|
361
|
+
title: string;
|
|
362
|
+
columns: ReportColumn[];
|
|
363
|
+
}
|
|
364
|
+
/** A table column with optional comparison behavior */
|
|
365
|
+
type ReportColumn = AnyColumn<Record<string, unknown>> & {
|
|
366
|
+
/** Add diff column after this column when baseline exists */comparable?: boolean; /** Set true for throughput metrics where higher values are better (e.g., lines/sec) */
|
|
367
|
+
higherIsBetter?: boolean; /** Stat descriptor: framework computes value from samples via computeStat */
|
|
368
|
+
statKind?: StatKind; /** Accessor for non-sample data (e.g., run count, metadata fields) */
|
|
369
|
+
value?: (results: MeasuredResults, metadata?: UnknownRecord) => unknown; /** Convert a timing-domain value to display domain (e.g., ms to lines/sec) */
|
|
370
|
+
toDisplay?: (timingValue: number, metadata?: Record<string, unknown>) => number;
|
|
371
|
+
};
|
|
372
|
+
type UnknownRecord = Record<string, unknown>;
|
|
373
|
+
/** Compute column values for a section from results + metadata.
|
|
374
|
+
* statKind columns: computeStat(samples, kind), then toDisplay.
|
|
375
|
+
* value columns: call the accessor directly. */
|
|
376
|
+
declare function computeColumnValues(section: ReportSection, results: MeasuredResults, metadata?: UnknownRecord): UnknownRecord;
|
|
377
|
+
/** True if any result in the groups has the specified field with a defined value */
|
|
378
|
+
declare function hasField(groups: ReportGroup[], field: keyof MeasuredResults): boolean;
|
|
428
379
|
//#endregion
|
|
429
|
-
//#region src/GitUtils.d.ts
|
|
380
|
+
//#region src/report/GitUtils.d.ts
|
|
381
|
+
/** Git commit hash, date, and dirty status for version tracking */
|
|
382
|
+
interface GitVersion {
|
|
383
|
+
hash: string;
|
|
384
|
+
date: string;
|
|
385
|
+
dirty?: boolean;
|
|
386
|
+
}
|
|
430
387
|
/** Get current git version info. For dirty repos, uses most recent modified file date. */
|
|
431
388
|
declare function getCurrentGitVersion(): GitVersion | undefined;
|
|
432
389
|
/** Read baseline version from .baseline-version file */
|
|
@@ -434,184 +391,243 @@ declare function getBaselineVersion(baselineDir?: string): GitVersion | undefine
|
|
|
434
391
|
/** Format git version for display: "abc1234 (Jan 9, 2026, 3:45 PM)" or "abc1234*" if dirty */
|
|
435
392
|
declare function formatGitVersion(version: GitVersion): string;
|
|
436
393
|
//#endregion
|
|
437
|
-
//#region src/
|
|
438
|
-
|
|
439
|
-
|
|
394
|
+
//#region src/cli/CliExport.d.ts
|
|
395
|
+
/** Options for exporting benchmark results to various formats */
|
|
396
|
+
interface ExportOptions {
|
|
397
|
+
results: ReportGroup[];
|
|
398
|
+
args: DefaultCliArgs;
|
|
399
|
+
sections?: ReportSection[];
|
|
400
|
+
currentVersion?: GitVersion;
|
|
401
|
+
baselineVersion?: GitVersion;
|
|
402
|
+
}
|
|
403
|
+
/** Export options for matrix benchmarks (results/args supplied by the matrix pipeline). */
|
|
404
|
+
interface MatrixExportOptions {
|
|
405
|
+
sections?: ReportSection[];
|
|
406
|
+
currentVersion?: GitVersion;
|
|
407
|
+
baselineVersion?: GitVersion;
|
|
408
|
+
}
|
|
409
|
+
/** Export reports (JSON, Perfetto, archive, viewer) based on CLI args. */
|
|
410
|
+
declare function exportReports(options: ExportOptions): Promise<void>;
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/matrix/CaseLoader.d.ts
|
|
413
|
+
/** Module exporting case IDs and an optional loader for case data */
|
|
414
|
+
interface CasesModule<T = unknown> {
|
|
415
|
+
cases: string[];
|
|
416
|
+
/** Subset of cases for quick runs */
|
|
417
|
+
defaultCases?: string[];
|
|
418
|
+
/** Subset of variants for quick runs */
|
|
419
|
+
defaultVariants?: string[];
|
|
420
|
+
loadCase?: (id: string) => LoadedCase<T> | Promise<LoadedCase<T>>;
|
|
421
|
+
}
|
|
422
|
+
/** Import and validate a cases module, which must export a `cases` array */
|
|
423
|
+
declare function loadCasesModule<T = unknown>(moduleUrl: string): Promise<CasesModule<T>>;
|
|
424
|
+
/** Load case data from a CasesModule, or use the caseId as data if no module */
|
|
425
|
+
declare function loadCaseData<T>(casesModule: CasesModule<T> | undefined, caseId: string): Promise<LoadedCase<T>>;
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region src/matrix/BenchMatrix.d.ts
|
|
428
|
+
/** Stateless variant - called each iteration with case data */
|
|
429
|
+
type VariantFn<T = unknown> = (caseData: T) => void;
|
|
430
|
+
/** Stateful variant - setup once, run many */
|
|
431
|
+
interface StatefulVariant<T = unknown, S = unknown> {
|
|
432
|
+
setup: (caseData: T) => S | Promise<S>;
|
|
433
|
+
run: (state: S) => void;
|
|
434
|
+
}
|
|
435
|
+
/** A variant is either a plain function or a stateful setup+run pair */
|
|
436
|
+
type Variant<T = unknown, S = unknown> = VariantFn<T> | StatefulVariant<T, S>;
|
|
437
|
+
/** Variant with any state type, allowing mixed variants in a matrix */
|
|
438
|
+
type AnyVariant<T = unknown> = VariantFn<T> | StatefulVariant<T, any>;
|
|
439
|
+
/** Case data and optional metadata returned by a cases module */
|
|
440
|
+
interface LoadedCase<T = unknown> {
|
|
441
|
+
data: T;
|
|
442
|
+
metadata?: Record<string, unknown>;
|
|
443
|
+
}
|
|
444
|
+
/** Default runner settings applied to all matrix benchmarks */
|
|
445
|
+
interface MatrixDefaults {
|
|
446
|
+
warmup?: number;
|
|
447
|
+
maxTime?: number;
|
|
448
|
+
iterations?: number;
|
|
449
|
+
}
|
|
450
|
+
/** Configuration for a cases x variants benchmark matrix */
|
|
451
|
+
interface BenchMatrix<T = unknown> {
|
|
452
|
+
name: string;
|
|
453
|
+
variantDir?: string;
|
|
454
|
+
variants?: Record<string, AnyVariant<T>>;
|
|
455
|
+
cases?: string[];
|
|
456
|
+
casesModule?: string;
|
|
457
|
+
baselineDir?: string;
|
|
458
|
+
baselineVariant?: string;
|
|
459
|
+
defaults?: MatrixDefaults;
|
|
460
|
+
}
|
|
461
|
+
/** Named collection of benchmark matrices */
|
|
462
|
+
interface MatrixSuite {
|
|
463
|
+
name: string;
|
|
464
|
+
matrices: BenchMatrix<any>[];
|
|
465
|
+
}
|
|
466
|
+
/** Results for a single variant across all cases */
|
|
467
|
+
interface VariantResult {
|
|
468
|
+
id: string;
|
|
469
|
+
cases: CaseResult[];
|
|
470
|
+
}
|
|
471
|
+
/** Results for a single (variant, case) pair */
|
|
472
|
+
interface CaseResult {
|
|
473
|
+
caseId: string;
|
|
474
|
+
measured: MeasuredResults;
|
|
475
|
+
metadata?: Record<string, unknown>;
|
|
476
|
+
baseline?: MeasuredResults;
|
|
477
|
+
deltaPercent?: number;
|
|
478
|
+
}
|
|
479
|
+
/** Aggregated results from running a benchmark matrix */
|
|
480
|
+
interface MatrixResults {
|
|
481
|
+
name: string;
|
|
482
|
+
variants: VariantResult[];
|
|
483
|
+
}
|
|
484
|
+
/** Options for {@link runMatrix} */
|
|
485
|
+
interface RunMatrixOptions {
|
|
486
|
+
/** Maximum iterations per benchmark */
|
|
487
|
+
iterations?: number;
|
|
488
|
+
/** Maximum time in ms per benchmark */
|
|
489
|
+
maxTime?: number;
|
|
490
|
+
/** Number of warmup iterations before measurement */
|
|
491
|
+
warmup?: number;
|
|
492
|
+
/** Use worker process isolation (default: true for variantDir) */
|
|
493
|
+
useWorker?: boolean;
|
|
494
|
+
/** Number of interleaved batches for baseline comparison */
|
|
495
|
+
batches?: number;
|
|
496
|
+
/** Include first batch in results (normally dropped for OS cache warmup) */
|
|
497
|
+
warmupBatch?: boolean;
|
|
498
|
+
/** Run only these cases (from --filter) */
|
|
499
|
+
filteredCases?: string[];
|
|
500
|
+
/** Run only these variants (from --filter) */
|
|
501
|
+
filteredVariants?: string[];
|
|
502
|
+
/** Force garbage collection between iterations */
|
|
503
|
+
gcForce?: boolean;
|
|
504
|
+
/** Track V8 optimization/deoptimization events */
|
|
505
|
+
traceOpt?: boolean;
|
|
506
|
+
/** Pause duration in ms before warmup begins */
|
|
507
|
+
pauseWarmup?: number;
|
|
508
|
+
/** Pause duration in ms before first measurement */
|
|
509
|
+
pauseFirst?: number;
|
|
510
|
+
/** Pause every N iterations during measurement */
|
|
511
|
+
pauseInterval?: number;
|
|
512
|
+
/** Duration of each pause in ms */
|
|
513
|
+
pauseDuration?: number;
|
|
514
|
+
/** Collect GC statistics via --trace-gc-nvp */
|
|
515
|
+
gcStats?: boolean;
|
|
516
|
+
/** Enable heap allocation profiling */
|
|
517
|
+
alloc?: boolean;
|
|
518
|
+
/** Heap sampling interval in bytes */
|
|
519
|
+
allocInterval?: number;
|
|
520
|
+
/** Maximum stack depth for allocation traces */
|
|
521
|
+
allocDepth?: number;
|
|
522
|
+
/** Enable CPU time profiling */
|
|
523
|
+
profile?: boolean;
|
|
524
|
+
/** CPU profiling sample interval in microseconds */
|
|
525
|
+
profileInterval?: number;
|
|
526
|
+
/** Track function call counts via V8 coverage */
|
|
527
|
+
callCounts?: boolean;
|
|
528
|
+
}
|
|
529
|
+
/** Run a BenchMatrix with inline variants or variantDir */
|
|
530
|
+
declare function runMatrix<T>(matrix: BenchMatrix<T>, options?: RunMatrixOptions): Promise<MatrixResults>;
|
|
531
|
+
/** Type guard for StatefulVariant */
|
|
532
|
+
declare function isStatefulVariant<T, S>(v: Variant<T, S>): v is StatefulVariant<T, S>;
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/profiling/node/ResolvedProfile.d.ts
|
|
535
|
+
/** A call frame with display-ready 1-indexed source positions */
|
|
536
|
+
interface ResolvedFrame {
|
|
537
|
+
/** Function name, "(anonymous)" when empty */
|
|
538
|
+
name: string;
|
|
539
|
+
/** Script URL or file path, "" when unknown */
|
|
440
540
|
url: string;
|
|
541
|
+
/** 1-indexed line number */
|
|
441
542
|
line: number;
|
|
543
|
+
/** 1-indexed column number (undefined when unknown) */
|
|
442
544
|
col?: number;
|
|
443
545
|
}
|
|
444
|
-
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/profiling/node/HeapSampleReport.d.ts
|
|
548
|
+
/** Predicate that returns true for user code (vs. runtime internals) */
|
|
549
|
+
type UserCodeFilter = (site: ResolvedFrame) => boolean;
|
|
550
|
+
/** Options for {@link formatHeapReport} */
|
|
445
551
|
interface HeapReportOptions {
|
|
552
|
+
/** Max sites to display */
|
|
446
553
|
topN: number;
|
|
554
|
+
/** Caller stack frames to show per site (default 3) */
|
|
447
555
|
stackDepth?: number;
|
|
556
|
+
/** Multi-line format with file paths (default false) */
|
|
448
557
|
verbose?: boolean;
|
|
558
|
+
/** Dump every raw sample */
|
|
449
559
|
raw?: boolean;
|
|
560
|
+
/** Filter to user code only, hiding runtime internals */
|
|
450
561
|
userOnly?: boolean;
|
|
562
|
+
/** Predicate for user vs internal code (default {@link isNodeUserCode}) */
|
|
451
563
|
isUserCode?: UserCodeFilter;
|
|
564
|
+
/** Total bytes across all nodes (before filtering) */
|
|
452
565
|
totalAll?: number;
|
|
566
|
+
/** Total bytes for user code only */
|
|
453
567
|
totalUserCode?: number;
|
|
568
|
+
/** Number of samples taken */
|
|
454
569
|
sampleCount?: number;
|
|
455
570
|
}
|
|
456
571
|
//#endregion
|
|
572
|
+
//#region src/cli/CliOptions.d.ts
|
|
573
|
+
/** Convert CLI args to matrix runner options. */
|
|
574
|
+
declare function cliToMatrixOptions(args: DefaultCliArgs): RunMatrixOptions;
|
|
575
|
+
//#endregion
|
|
457
576
|
//#region src/matrix/MatrixReport.d.ts
|
|
458
|
-
/**
|
|
459
|
-
interface ExtraColumn {
|
|
460
|
-
key: string;
|
|
461
|
-
title: string;
|
|
462
|
-
groupTitle?: string;
|
|
463
|
-
extract: (caseResult: CaseResult) => unknown;
|
|
464
|
-
formatter?: (value: unknown) => string;
|
|
465
|
-
}
|
|
466
|
-
/** Options for matrix report generation */
|
|
577
|
+
/** Options for {@link reportMatrixResults} */
|
|
467
578
|
interface MatrixReportOptions {
|
|
468
|
-
|
|
469
|
-
sections?:
|
|
579
|
+
/** ReportSection sections (default: [timeSection, runsSection]) */
|
|
580
|
+
sections?: ReportSection[];
|
|
581
|
+
/** Custom title for the variant column (default: "variant") */
|
|
470
582
|
variantTitle?: string;
|
|
583
|
+
/** Comparison options (equivalence margin, batch trimming) */
|
|
584
|
+
comparison?: ComparisonOptions;
|
|
471
585
|
}
|
|
472
|
-
/**
|
|
473
|
-
declare const gcStatsColumns: ExtraColumn[];
|
|
474
|
-
/** GC pause time column */
|
|
475
|
-
declare const gcPauseColumn: ExtraColumn;
|
|
476
|
-
/** Heap sampling total bytes column */
|
|
477
|
-
declare const heapTotalColumn: ExtraColumn;
|
|
478
|
-
/** Format matrix results as one table per case */
|
|
586
|
+
/** Format matrix results as text, with one table per case */
|
|
479
587
|
declare function reportMatrixResults(results: MatrixResults, options?: MatrixReportOptions): string;
|
|
480
588
|
//#endregion
|
|
481
|
-
//#region src/cli/
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
interface MatrixExportOptions {
|
|
491
|
-
sections?: any[];
|
|
492
|
-
currentVersion?: GitVersion;
|
|
493
|
-
baselineVersion?: GitVersion;
|
|
494
|
-
}
|
|
495
|
-
/** Parse CLI with custom configuration */
|
|
496
|
-
declare function parseBenchArgs<T = DefaultCliArgs>(configureArgs?: Configure<T>): T & DefaultCliArgs;
|
|
497
|
-
/** Run suite with CLI arguments */
|
|
498
|
-
declare function runBenchmarks(suite: BenchSuite, args: DefaultCliArgs): Promise<ReportGroup[]>;
|
|
499
|
-
/** Generate table with standard sections */
|
|
500
|
-
declare function defaultReport(groups: ReportGroup[], args: DefaultCliArgs): string;
|
|
501
|
-
/** Run benchmarks, display table, and optionally generate HTML report */
|
|
502
|
-
declare function benchExports(suite: BenchSuite, args: DefaultCliArgs): Promise<void>;
|
|
503
|
-
/** Print heap allocation reports for benchmarks with heap profiles */
|
|
504
|
-
declare function printHeapReports(groups: ReportGroup[], options: HeapReportOptions): void;
|
|
505
|
-
/** Run benchmarks and display table. Suite is optional with --url (browser mode). */
|
|
506
|
-
declare function runDefaultBench(suite?: BenchSuite, configureArgs?: Configure<any>): Promise<void>;
|
|
507
|
-
/** Log V8 optimization tier distribution and deoptimizations */
|
|
589
|
+
//#region src/cli/CliReport.d.ts
|
|
590
|
+
/** Options for defaultReport: custom sections replace the CLI-derived defaults. */
|
|
591
|
+
interface DefaultReportOptions {
|
|
592
|
+
sections?: ReportSection[];
|
|
593
|
+
}
|
|
594
|
+
/** Generate text report table with standard sections based on CLI args. */
|
|
595
|
+
declare function defaultReport(groups: ReportGroup[], args: DefaultCliArgs, opts?: DefaultReportOptions): string;
|
|
596
|
+
/** Log V8 optimization tier distribution and deoptimizations. */
|
|
508
597
|
declare function reportOptStatus(groups: ReportGroup[]): void;
|
|
509
|
-
/**
|
|
510
|
-
declare function
|
|
511
|
-
/**
|
|
512
|
-
declare function exportReports(options: ExportOptions): Promise<void>;
|
|
513
|
-
/** Run matrix suite with CLI arguments.
|
|
514
|
-
* no options ==> defaultCases/defaultVariants, --filter ==> subset of defaults,
|
|
515
|
-
* --all --filter ==> subset of all, --all ==> all cases/variants */
|
|
516
|
-
declare function runMatrixSuite(suite: MatrixSuite, args: DefaultCliArgs): Promise<MatrixResults[]>;
|
|
517
|
-
/** Convert CLI args to matrix run options */
|
|
518
|
-
declare function cliToMatrixOptions(args: DefaultCliArgs): RunMatrixOptions;
|
|
519
|
-
/** Generate report for matrix results. Uses same sections as regular benchmarks. */
|
|
598
|
+
/** Print heap allocation profiles for each benchmark in the report groups. */
|
|
599
|
+
declare function printHeapReports(groups: ReportGroup[], options: HeapReportOptions): void;
|
|
600
|
+
/** Format matrix benchmark results as text, applying default sections from CLI args. */
|
|
520
601
|
declare function defaultMatrixReport(results: MatrixResults[], reportOptions?: MatrixReportOptions, args?: DefaultCliArgs): string;
|
|
521
|
-
/**
|
|
522
|
-
declare function runDefaultMatrixBench(suite: MatrixSuite, configureArgs?: Configure<any>, reportOptions?: MatrixReportOptions): Promise<void>;
|
|
523
|
-
/** Convert MatrixResults to ReportGroup[] for export compatibility */
|
|
602
|
+
/** Convert MatrixResults to ReportGroup[] for the standard export pipeline. */
|
|
524
603
|
declare function matrixToReportGroups(results: MatrixResults[]): ReportGroup[];
|
|
525
|
-
/** Run matrix benchmarks, display table, and generate exports */
|
|
526
|
-
declare function matrixBenchExports(suite: MatrixSuite, args: DefaultCliArgs, reportOptions?: MatrixReportOptions, exportOptions?: MatrixExportOptions): Promise<void>;
|
|
527
604
|
//#endregion
|
|
528
|
-
//#region src/
|
|
529
|
-
/**
|
|
530
|
-
interface
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
interface BenchmarkGroup {
|
|
548
|
-
name: string;
|
|
549
|
-
baseline?: BenchmarkResult;
|
|
550
|
-
benchmarks: BenchmarkResult[];
|
|
551
|
-
}
|
|
552
|
-
interface BenchmarkResult {
|
|
553
|
-
name: string;
|
|
554
|
-
status: "completed" | "running" | "failed";
|
|
555
|
-
/** Raw execution time samples in milliseconds */
|
|
556
|
-
samples: number[];
|
|
557
|
-
/** Statistical summaries */
|
|
558
|
-
time: {
|
|
559
|
-
min: number;
|
|
560
|
-
max: number;
|
|
561
|
-
mean: number;
|
|
562
|
-
p50: number;
|
|
563
|
-
p75: number;
|
|
564
|
-
p99: number;
|
|
565
|
-
p999: number;
|
|
566
|
-
};
|
|
567
|
-
/** Optional performance metrics */
|
|
568
|
-
heapSize?: {
|
|
569
|
-
min: number;
|
|
570
|
-
max: number;
|
|
571
|
-
mean: number;
|
|
572
|
-
};
|
|
573
|
-
gcTime?: {
|
|
574
|
-
min: number;
|
|
575
|
-
max: number;
|
|
576
|
-
mean: number;
|
|
577
|
-
};
|
|
578
|
-
cpu?: {
|
|
579
|
-
instructions?: number;
|
|
580
|
-
cycles?: number;
|
|
581
|
-
cacheMisses?: number;
|
|
582
|
-
branchMisses?: number;
|
|
583
|
-
};
|
|
584
|
-
/** Execution metadata */
|
|
585
|
-
execution: {
|
|
586
|
-
iterations: number;
|
|
587
|
-
totalTime: number;
|
|
588
|
-
warmupRuns?: number;
|
|
589
|
-
};
|
|
590
|
-
/** Adaptive mode results */
|
|
591
|
-
adaptive?: {
|
|
592
|
-
confidenceInterval: {
|
|
593
|
-
lower: number;
|
|
594
|
-
upper: number;
|
|
595
|
-
margin: number;
|
|
596
|
-
marginPercent: number;
|
|
597
|
-
confidence: number;
|
|
598
|
-
};
|
|
599
|
-
converged: boolean;
|
|
600
|
-
stopReason: "threshold_met" | "max_time" | "max_iterations";
|
|
601
|
-
};
|
|
602
|
-
/** Error information */
|
|
603
|
-
error?: {
|
|
604
|
-
message: string;
|
|
605
|
-
type: string;
|
|
606
|
-
stackTrace?: string;
|
|
607
|
-
};
|
|
608
|
-
}
|
|
605
|
+
//#region src/cli/RunBenchCLI.d.ts
|
|
606
|
+
/** Options for running a BenchSuite: custom sections replace the CLI-derived defaults. */
|
|
607
|
+
interface BenchExportsOptions {
|
|
608
|
+
sections?: ReportSection[];
|
|
609
|
+
}
|
|
610
|
+
/** Top-level CLI dispatch: route to view, analyze, or default bench runner. */
|
|
611
|
+
declare function dispatchCli(): Promise<void>;
|
|
612
|
+
/** Run benchmarks and display results. Suite is optional with --url (browser mode). */
|
|
613
|
+
declare function runDefaultBench(suite?: BenchSuite, configureArgs?: Configure<any>, argv?: string[], opts?: BenchExportsOptions): Promise<void>;
|
|
614
|
+
/** Parse CLI args with optional custom yargs configuration. */
|
|
615
|
+
declare function parseBenchArgs<T = DefaultCliArgs>(configureArgs?: Configure<T>, argv?: string[]): T & DefaultCliArgs;
|
|
616
|
+
/** Run a BenchSuite and print results with standard reporting. */
|
|
617
|
+
declare function benchExports(suite: BenchSuite, args: DefaultCliArgs, opts?: BenchExportsOptions): Promise<void>;
|
|
618
|
+
/** Run matrix suite with full CLI handling (parse, run, report, export). */
|
|
619
|
+
declare function runDefaultMatrixBench(suite: MatrixSuite, configureArgs?: Configure<any>, reportOptions?: MatrixReportOptions): Promise<void>;
|
|
620
|
+
/** Run a matrix suite, print results, and handle exports. */
|
|
621
|
+
declare function matrixBenchExports(suite: MatrixSuite, args: DefaultCliArgs, reportOptions?: MatrixReportOptions, exportOptions?: MatrixExportOptions): Promise<void>;
|
|
622
|
+
/** Run matrix suite with CLI arguments. --filter narrows defaults, --all --filter narrows all. */
|
|
623
|
+
declare function runMatrixSuite(suite: MatrixSuite, args: DefaultCliArgs): Promise<MatrixResults[]>;
|
|
609
624
|
//#endregion
|
|
610
|
-
//#region src/
|
|
611
|
-
/**
|
|
612
|
-
declare function
|
|
625
|
+
//#region src/cli/SuiteRunner.d.ts
|
|
626
|
+
/** Run a benchmark suite with CLI arguments. */
|
|
627
|
+
declare function runBenchmarks(suite: BenchSuite, args: DefaultCliArgs): Promise<ReportGroup[]>;
|
|
613
628
|
//#endregion
|
|
614
|
-
//#region src/export/
|
|
629
|
+
//#region src/export/SpeedscopeTypes.d.ts
|
|
630
|
+
/** Shared speedscope file format types and frame interning utilities. */
|
|
615
631
|
/** speedscope file format (https://www.speedscope.app/file-format-schema.json) */
|
|
616
632
|
interface SpeedscopeFile {
|
|
617
633
|
$schema: "https://www.speedscope.app/file-format-schema.json";
|
|
@@ -622,13 +638,17 @@ interface SpeedscopeFile {
|
|
|
622
638
|
name?: string;
|
|
623
639
|
exporter?: string;
|
|
624
640
|
}
|
|
641
|
+
/** A single call frame with optional source location */
|
|
625
642
|
interface SpeedscopeFrame {
|
|
626
643
|
name: string;
|
|
627
644
|
file?: string;
|
|
628
645
|
line?: number;
|
|
629
646
|
col?: number;
|
|
630
647
|
}
|
|
631
|
-
|
|
648
|
+
/** Union of heap and time profile shapes (unit differs) */
|
|
649
|
+
type SpeedscopeProfile = SpeedscopeHeapProfile | SpeedscopeTimeProfile;
|
|
650
|
+
/** Heap allocation profile weighted by bytes */
|
|
651
|
+
interface SpeedscopeHeapProfile {
|
|
632
652
|
type: "sampled";
|
|
633
653
|
name: string;
|
|
634
654
|
unit: "bytes";
|
|
@@ -637,39 +657,185 @@ interface SpeedscopeProfile {
|
|
|
637
657
|
samples: number[][];
|
|
638
658
|
weights: number[];
|
|
639
659
|
}
|
|
640
|
-
/**
|
|
641
|
-
|
|
642
|
-
|
|
660
|
+
/** CPU time profile weighted by microseconds */
|
|
661
|
+
interface SpeedscopeTimeProfile {
|
|
662
|
+
type: "sampled";
|
|
663
|
+
name: string;
|
|
664
|
+
unit: "microseconds";
|
|
665
|
+
startValue: number;
|
|
666
|
+
endValue: number;
|
|
667
|
+
samples: number[][];
|
|
668
|
+
weights: number[];
|
|
669
|
+
}
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region src/export/AllocExport.d.ts
|
|
672
|
+
/** Export heap profiles to speedscope JSON. Returns output path, or undefined if no profiles. */
|
|
643
673
|
declare function exportSpeedscope(groups: ReportGroup[], outputPath: string): string | undefined;
|
|
644
|
-
/**
|
|
645
|
-
declare function exportAndLaunchSpeedscope(groups: ReportGroup[]): void;
|
|
646
|
-
/** Launch speedscope viewer on a file via npx */
|
|
647
|
-
declare function launchSpeedscope(filePath: string): void;
|
|
648
|
-
/** Convert a single HeapProfile to speedscope format (for standalone use) */
|
|
674
|
+
/** Convert a single HeapProfile to speedscope format. */
|
|
649
675
|
declare function heapProfileToSpeedscope(name: string, profile: HeapProfile): SpeedscopeFile;
|
|
676
|
+
/** Build SpeedscopeFile from report groups. Returns undefined if no profiles found. */
|
|
677
|
+
declare function buildSpeedscopeFile(groups: ReportGroup[]): SpeedscopeFile | undefined;
|
|
650
678
|
//#endregion
|
|
651
|
-
//#region src/
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
679
|
+
//#region src/viewer/ReportData.d.ts
|
|
680
|
+
/** Top-level data structure for the HTML benchmark report. */
|
|
681
|
+
interface ReportData {
|
|
682
|
+
groups: BenchmarkGroup[];
|
|
683
|
+
metadata: {
|
|
684
|
+
timestamp: string;
|
|
685
|
+
bencherVersion: string;
|
|
686
|
+
cliArgs?: Record<string, unknown>;
|
|
687
|
+
cliDefaults?: Record<string, unknown>;
|
|
688
|
+
gcTrackingEnabled?: boolean;
|
|
689
|
+
currentVersion?: GitVersion;
|
|
690
|
+
baselineVersion?: GitVersion;
|
|
691
|
+
environment?: {
|
|
692
|
+
node: string;
|
|
693
|
+
platform: string;
|
|
694
|
+
arch: string;
|
|
695
|
+
};
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
/** A named group of benchmarks, optionally compared against a baseline. */
|
|
699
|
+
interface BenchmarkGroup {
|
|
700
|
+
name: string;
|
|
701
|
+
baseline?: BenchmarkEntry;
|
|
702
|
+
benchmarks: BenchmarkEntry[];
|
|
703
|
+
warnings?: string[];
|
|
704
|
+
}
|
|
705
|
+
/** One benchmark's raw data, statistics, and optional comparison results. */
|
|
706
|
+
interface BenchmarkEntry {
|
|
707
|
+
name: string;
|
|
708
|
+
samples: number[];
|
|
709
|
+
warmupSamples?: number[];
|
|
710
|
+
allocationSamples?: number[];
|
|
711
|
+
heapSamples?: number[];
|
|
712
|
+
gcEvents?: GcEvent[];
|
|
713
|
+
optSamples?: number[];
|
|
714
|
+
pausePoints?: PausePoint[];
|
|
715
|
+
batchOffsets?: number[];
|
|
716
|
+
stats: BenchmarkStats;
|
|
717
|
+
heapSize?: {
|
|
718
|
+
min: number;
|
|
719
|
+
max: number;
|
|
720
|
+
avg: number;
|
|
721
|
+
};
|
|
722
|
+
totalTime?: number;
|
|
723
|
+
sections?: ViewerSection[];
|
|
724
|
+
coverageSummary?: CoverageSummary;
|
|
725
|
+
heapSummary?: HeapSummary;
|
|
726
|
+
comparisonCI?: DifferenceCI;
|
|
727
|
+
}
|
|
728
|
+
/** Summary percentile statistics for a benchmark's samples. */
|
|
729
|
+
interface BenchmarkStats {
|
|
730
|
+
min: number;
|
|
731
|
+
max: number;
|
|
732
|
+
avg: number;
|
|
733
|
+
p50: number;
|
|
734
|
+
p75: number;
|
|
735
|
+
p99: number;
|
|
736
|
+
p999: number;
|
|
737
|
+
cv?: number;
|
|
738
|
+
mad?: number;
|
|
739
|
+
outlierRate?: number;
|
|
740
|
+
}
|
|
741
|
+
/** A section of related stats for the viewer (e.g., "Lines / Sec", "GC"). */
|
|
742
|
+
interface ViewerSection {
|
|
743
|
+
title: string;
|
|
744
|
+
tabLink?: string;
|
|
745
|
+
rows: ViewerRow[];
|
|
746
|
+
}
|
|
747
|
+
/** A stat row with per-run values and optional comparison CI. */
|
|
748
|
+
interface ViewerRow {
|
|
749
|
+
label: string;
|
|
750
|
+
entries: ViewerEntry[];
|
|
751
|
+
comparisonCI?: DifferenceCI;
|
|
752
|
+
shared?: boolean;
|
|
753
|
+
/** First comparable row with a statKind in the section. */
|
|
754
|
+
primary?: boolean;
|
|
755
|
+
}
|
|
756
|
+
/** A single run's value for a stat. */
|
|
757
|
+
interface ViewerEntry {
|
|
758
|
+
runName: string;
|
|
759
|
+
value: string;
|
|
760
|
+
bootstrapCI?: BootstrapCIData;
|
|
761
|
+
}
|
|
762
|
+
/** Bootstrap CI data for inline visualization. */
|
|
763
|
+
interface BootstrapCIData {
|
|
764
|
+
estimate: number;
|
|
765
|
+
ci: [number, number];
|
|
766
|
+
histogram: HistogramBin[];
|
|
767
|
+
/** Formatted CI bounds for display (e.g., ["0.12ms", "0.15ms"]) */
|
|
768
|
+
ciLabels?: [string, string];
|
|
769
|
+
/** Block-level (between-run) or sample-level (within-run) resampling */
|
|
770
|
+
ciLevel?: CILevel;
|
|
771
|
+
/** false when batch count is too low for reliable CI */
|
|
772
|
+
ciReliable?: boolean;
|
|
773
|
+
}
|
|
774
|
+
/** Summary of coverage/call-count data. */
|
|
775
|
+
interface CoverageSummary {
|
|
776
|
+
functionCount: number;
|
|
777
|
+
totalCalls: number;
|
|
778
|
+
}
|
|
779
|
+
/** Summary of heap allocation profile. */
|
|
780
|
+
interface HeapSummary {
|
|
781
|
+
totalBytes: number;
|
|
782
|
+
userBytes: number;
|
|
783
|
+
}
|
|
784
|
+
/** A garbage collection event with timing relative to the benchmark start. */
|
|
785
|
+
interface GcEvent {
|
|
786
|
+
offset: number;
|
|
787
|
+
duration: number;
|
|
657
788
|
}
|
|
658
|
-
/** Prepare ReportData from benchmark results for HTML rendering */
|
|
659
|
-
declare function prepareHtmlData(groups: ReportGroup[], options: PrepareHtmlOptions): ReportData;
|
|
660
789
|
//#endregion
|
|
661
|
-
//#region src/
|
|
662
|
-
/**
|
|
663
|
-
interface
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
790
|
+
//#region src/export/CoverageExport.d.ts
|
|
791
|
+
/** Per-function execution count at a specific source line. */
|
|
792
|
+
interface LineCoverage {
|
|
793
|
+
/** 1-indexed line number of the function start */
|
|
794
|
+
startLine: number;
|
|
795
|
+
/** Function name (empty string for anonymous top-level) */
|
|
796
|
+
functionName: string;
|
|
797
|
+
/** Number of times the function was invoked */
|
|
798
|
+
count: number;
|
|
668
799
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
800
|
+
//#endregion
|
|
801
|
+
//#region src/export/ArchiveFormat.d.ts
|
|
802
|
+
interface BenchforgeArchive {
|
|
803
|
+
/** Archive format version. */
|
|
804
|
+
schema: number;
|
|
805
|
+
/** Heap allocation profile in Speedscope format. */
|
|
806
|
+
allocProfile?: SpeedscopeFile;
|
|
807
|
+
/** CPU time profile in Speedscope format. */
|
|
808
|
+
timeProfile?: SpeedscopeFile;
|
|
809
|
+
/** Per-line coverage data keyed by source URL. */
|
|
810
|
+
coverage?: Record<string, LineCoverage[]>;
|
|
811
|
+
/** Benchmark report with suite results and statistics. */
|
|
812
|
+
report?: ReportData;
|
|
813
|
+
/** Source file contents keyed by file URL. */
|
|
814
|
+
sources: Record<string, string>;
|
|
815
|
+
/** Archive creation metadata. */
|
|
816
|
+
metadata: ArchiveMetadata;
|
|
817
|
+
}
|
|
818
|
+
interface ArchiveMetadata {
|
|
819
|
+
/** ISO timestamp (colons/periods replaced with dashes for filename safety). */
|
|
820
|
+
timestamp: string;
|
|
821
|
+
/** Benchforge package version. */
|
|
822
|
+
benchforgeVersion: string;
|
|
823
|
+
}
|
|
824
|
+
//#endregion
|
|
825
|
+
//#region src/export/ArchiveExport.d.ts
|
|
826
|
+
interface ArchiveOptions {
|
|
827
|
+
groups: ReportGroup[];
|
|
828
|
+
reportData?: ReportData;
|
|
829
|
+
timeProfileData?: string;
|
|
830
|
+
coverageData?: string;
|
|
831
|
+
outputPath?: string;
|
|
832
|
+
}
|
|
833
|
+
/** Build a .benchforge archive file. Returns output path, or undefined if nothing to archive. */
|
|
834
|
+
declare function archiveBenchmark(options: ArchiveOptions): Promise<string | undefined>;
|
|
835
|
+
//#endregion
|
|
836
|
+
//#region src/export/PerfettoExport.d.ts
|
|
837
|
+
/** Export benchmark results to Perfetto-compatible trace file */
|
|
838
|
+
declare function exportPerfettoTrace(groups: ReportGroup[], outputPath: string, args: DefaultCliArgs): void;
|
|
673
839
|
//#endregion
|
|
674
840
|
//#region src/matrix/MatrixFilter.d.ts
|
|
675
841
|
/** Filter for matrix case/variant selection */
|
|
@@ -687,84 +853,71 @@ declare function parseMatrixFilter(filter: string): MatrixFilter;
|
|
|
687
853
|
/** Apply filter to a matrix, merging with existing filters via intersection */
|
|
688
854
|
declare function filterMatrix<T>(matrix: FilteredMatrix<T>, filter?: MatrixFilter): Promise<FilteredMatrix<T>>;
|
|
689
855
|
//#endregion
|
|
690
|
-
//#region src/
|
|
691
|
-
|
|
692
|
-
mean?: number;
|
|
693
|
-
p50?: number;
|
|
694
|
-
p99?: number;
|
|
695
|
-
}
|
|
696
|
-
interface GcSectionStats {
|
|
697
|
-
gc?: number;
|
|
698
|
-
}
|
|
699
|
-
interface GcStatsInfo {
|
|
700
|
-
allocPerIter?: number;
|
|
701
|
-
collected?: number;
|
|
702
|
-
scavenges?: number;
|
|
703
|
-
fullGCs?: number;
|
|
704
|
-
promoPercent?: number;
|
|
705
|
-
pausePerIter?: number;
|
|
706
|
-
}
|
|
707
|
-
interface CpuStats {
|
|
708
|
-
cpuCacheMiss?: number;
|
|
709
|
-
cpuStall?: number;
|
|
710
|
-
}
|
|
711
|
-
interface RunStats {
|
|
712
|
-
runs?: number;
|
|
713
|
-
}
|
|
714
|
-
interface AdaptiveStats {
|
|
715
|
-
median?: number;
|
|
716
|
-
mean?: number;
|
|
717
|
-
p99?: number;
|
|
718
|
-
convergence?: number;
|
|
719
|
-
}
|
|
720
|
-
interface OptStats {
|
|
721
|
-
tiers?: string;
|
|
722
|
-
deopt?: number;
|
|
723
|
-
}
|
|
724
|
-
/** Section: mean, p50, p99 timing */
|
|
725
|
-
declare const timeSection: ResultsMapper<TimeStats>;
|
|
726
|
-
/** Section: GC time as fraction of total benchmark time (Node performance hooks) */
|
|
727
|
-
declare const gcSection: ResultsMapper<GcSectionStats>;
|
|
728
|
-
/** Section: detailed GC stats from --trace-gc-nvp (allocation, promotion, pauses) */
|
|
729
|
-
declare const gcStatsSection: ResultsMapper<GcStatsInfo>;
|
|
730
|
-
/** Section: CPU L1 cache miss rate and stall rate (requires @mitata/counters) */
|
|
731
|
-
declare const cpuSection: ResultsMapper<CpuStats>;
|
|
732
|
-
/** Section: number of sample iterations */
|
|
733
|
-
declare const runsSection: ResultsMapper<RunStats>;
|
|
734
|
-
/** Section: total sampling duration in seconds (brackets if >= 30s) */
|
|
735
|
-
declare const totalTimeSection: ResultsMapper<{
|
|
736
|
-
totalTime?: number;
|
|
737
|
-
}>;
|
|
738
|
-
/** Section: median, mean, p99, and convergence for adaptive mode */
|
|
739
|
-
declare const adaptiveSection: ResultsMapper<AdaptiveStats>;
|
|
740
|
-
/** Section: V8 optimization tier distribution and deopt count */
|
|
741
|
-
declare const optSection: ResultsMapper<OptStats>;
|
|
742
|
-
/** Build generic sections based on CLI flags */
|
|
743
|
-
declare function buildGenericSections(args: {
|
|
744
|
-
"gc-stats"?: boolean;
|
|
745
|
-
"heap-sample"?: boolean;
|
|
746
|
-
}): ResultsMapper[];
|
|
747
|
-
//#endregion
|
|
748
|
-
//#region src/StatisticalUtils.d.ts
|
|
749
|
-
/** @return mean of values */
|
|
750
|
-
declare function average(values: number[]): number;
|
|
751
|
-
//#endregion
|
|
752
|
-
//#region src/table-util/ConvergenceFormatters.d.ts
|
|
753
|
-
/** @return convergence percentage with color for low values */
|
|
754
|
-
declare function formatConvergence(v: unknown): string;
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region src/table-util/Formatters.d.ts
|
|
757
|
-
/** Format time in milliseconds, showing very small values with units */
|
|
856
|
+
//#region src/report/Formatters.d.ts
|
|
857
|
+
/** Format time in milliseconds with appropriate units */
|
|
758
858
|
declare function timeMs(ms: unknown): string | null;
|
|
759
859
|
/** Format integer with thousand separators */
|
|
760
860
|
declare function integer(x: unknown): string | null;
|
|
761
|
-
/** Format bytes with appropriate units
|
|
762
|
-
* Use `space: true` for human-readable console output (`1.5 KB`). */
|
|
861
|
+
/** Format bytes with appropriate units. Use `space: true` for `1.5 KB` style. */
|
|
763
862
|
declare function formatBytes(bytes: unknown, opts?: {
|
|
764
863
|
space?: boolean;
|
|
765
864
|
}): string | null;
|
|
766
865
|
/** @return truncated string with ellipsis if over maxLen */
|
|
767
866
|
declare function truncate(str: string, maxLen?: number): string;
|
|
867
|
+
/** @return convergence percentage with color for low values */
|
|
868
|
+
declare function formatConvergence(v: unknown): string;
|
|
869
|
+
//#endregion
|
|
870
|
+
//#region src/report/GcSections.d.ts
|
|
871
|
+
/** Report section: GC time as fraction of total benchmark time. */
|
|
872
|
+
declare const gcSection: ReportSection;
|
|
873
|
+
/** Report section: detailed GC stats from --trace-gc-nvp. */
|
|
874
|
+
declare const gcStatsSection: ReportSection;
|
|
875
|
+
/** @return GC stats sections if enabled by CLI flags */
|
|
876
|
+
declare function gcSections(args: {
|
|
877
|
+
"gc-stats"?: boolean;
|
|
878
|
+
}): ReportSection[];
|
|
879
|
+
//#endregion
|
|
880
|
+
//#region src/report/HtmlReport.d.ts
|
|
881
|
+
/** Options for prepareHtmlData: report sections, git versions, and CLI args */
|
|
882
|
+
interface PrepareHtmlOptions extends ComparisonOptions {
|
|
883
|
+
cliArgs?: Record<string, unknown>;
|
|
884
|
+
sections?: ReportSection[];
|
|
885
|
+
currentVersion?: GitVersion;
|
|
886
|
+
baselineVersion?: GitVersion;
|
|
887
|
+
}
|
|
888
|
+
/** Convert benchmark results into a ReportData payload for the HTML viewer */
|
|
889
|
+
declare function prepareHtmlData(groups: ReportGroup[], options: PrepareHtmlOptions): ReportData;
|
|
890
|
+
//#endregion
|
|
891
|
+
//#region src/report/StandardSections.d.ts
|
|
892
|
+
/** Default timing section: mean, p50, p99. */
|
|
893
|
+
declare const timeSection: ReportSection;
|
|
894
|
+
/** Report section: number of sample iterations. */
|
|
895
|
+
declare const runsSection: ReportSection;
|
|
896
|
+
/** Report section: total sampling duration. */
|
|
897
|
+
declare const totalTimeSection: ReportSection;
|
|
898
|
+
/** Report sections: timing stats and convergence for adaptive mode. */
|
|
899
|
+
declare const adaptiveSections: ReportSection[];
|
|
900
|
+
/** Report section: V8 optimization tier distribution and deopt count. */
|
|
901
|
+
declare const optSection: ReportSection;
|
|
902
|
+
/** Build a time section with user-chosen percentile/stat columns. */
|
|
903
|
+
declare function buildTimeSection(stats?: string): ReportSection;
|
|
904
|
+
/** @return default report sections from CLI flags (GC stats if enabled, plus run count). */
|
|
905
|
+
declare function buildGenericSections(args: {
|
|
906
|
+
"gc-stats"?: boolean;
|
|
907
|
+
alloc?: boolean;
|
|
908
|
+
}): ReportSection[];
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/report/text/TextReport.d.ts
|
|
911
|
+
/** Options for text report rendering, including baseline comparison settings. */
|
|
912
|
+
interface TextReportOptions extends ComparisonOptions {}
|
|
913
|
+
/** Build a formatted text table from benchmark groups, with baseline diff columns when present. */
|
|
914
|
+
declare function reportResults(groups: ReportGroup[], sections: ReportSection[], options?: TextReportOptions): string;
|
|
915
|
+
//#endregion
|
|
916
|
+
//#region src/viewer/DateFormat.d.ts
|
|
917
|
+
/** Format ISO date as local time with UTC: "Jan 9, 2026, 3:45 PM (2026-01-09T23:45:00Z)" */
|
|
918
|
+
declare function formatDateWithTimezone(isoDate: string): string;
|
|
919
|
+
/** Format relative time: "5m ago", "2h ago", "yesterday", "3 days ago" */
|
|
920
|
+
declare function formatRelativeTime(isoDate: string): string;
|
|
768
921
|
//#endregion
|
|
769
|
-
export { type AnyVariant, type BenchGroup, type BenchMatrix, type BenchSuite,
|
|
922
|
+
export { type AnyVariant, type ArchiveMetadata, type BenchGroup, type BenchMatrix, type BenchSuite, type BenchforgeArchive, type BenchmarkReport, type BenchmarkSpec, type CaseResult, type CasesModule, type ComparisonOptions, type Configure, type DefaultCliArgs, type ExportOptions, type FilteredMatrix, type GitVersion, type LoadedCase, type MatrixDefaults, type MatrixExportOptions, type MatrixFilter, type MatrixReportOptions, type MatrixResults, type MatrixSuite, type MeasuredResults, type PrepareHtmlOptions, type ReportColumn, type ReportData, type ReportGroup, type ReportSection, type RunMatrixOptions, type RunnerOptions, type StatKind, type StatefulVariant, type UnknownRecord, type Variant, type VariantFn, type VariantResult, adaptiveSections, archiveBenchmark, average, benchExports, browserCliArgs, buildGenericSections, buildSpeedscopeFile, buildTimeSection, cliToMatrixOptions, computeColumnValues, computeStat, defaultCliArgs, defaultMatrixReport, defaultReport, dispatchCli, exportPerfettoTrace, exportReports, exportSpeedscope, filterMatrix, formatBytes, formatConvergence, formatDateWithTimezone, formatGitVersion, formatRelativeTime, gcSection, gcSections, gcStatsSection, getBaselineVersion, getCurrentGitVersion, hasField, heapProfileToSpeedscope, integer, isBootstrappable, isStatefulVariant, loadCaseData, loadCasesModule, matrixBenchExports, matrixToReportGroups, maxBootstrapInput, median, optSection, parseBenchArgs, parseCliArgs, parseMatrixFilter, percentile, prepareHtmlData, printHeapReports, reportMatrixResults, reportOptStatus, reportResults, runBenchmarks, runDefaultBench, runDefaultMatrixBench, runMatrix, runMatrixSuite, runsSection, timeMs, timeSection, totalTimeSection, truncate };
|
|
770
923
|
//# sourceMappingURL=index.d.mts.map
|