@cobol-ts/cli-benchmark 0.0.0-stage → 0.0.57
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/README.md +9 -3
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/src/benchmark.access.spec.d.ts +1 -0
- package/dist/src/benchmark.access.spec.js +30 -0
- package/dist/src/benchmark.access.spec.js.map +1 -0
- package/dist/src/benchmark.aggregate.fixture.d.ts +10 -0
- package/dist/src/benchmark.aggregate.fixture.js +110 -0
- package/dist/src/benchmark.aggregate.fixture.js.map +1 -0
- package/dist/src/benchmark.allocations.d.ts +19 -0
- package/dist/src/benchmark.allocations.js +83 -0
- package/dist/src/benchmark.allocations.js.map +1 -0
- package/dist/src/benchmark.allocations.spec.d.ts +1 -0
- package/dist/src/benchmark.allocations.spec.js +64 -0
- package/dist/src/benchmark.allocations.spec.js.map +1 -0
- package/dist/src/benchmark.builder.d.ts +8 -0
- package/dist/src/benchmark.builder.js +21 -0
- package/dist/src/benchmark.builder.js.map +1 -0
- package/dist/src/benchmark.calibration.spec.d.ts +1 -0
- package/dist/src/benchmark.calibration.spec.js +83 -0
- package/dist/src/benchmark.calibration.spec.js.map +1 -0
- package/dist/src/benchmark.command.d.ts +8 -0
- package/dist/src/benchmark.command.js +368 -0
- package/dist/src/benchmark.command.js.map +1 -0
- package/dist/src/benchmark.composed.fixture.d.ts +4 -0
- package/dist/src/benchmark.composed.fixture.js +80 -0
- package/dist/src/benchmark.composed.fixture.js.map +1 -0
- package/dist/src/benchmark.composed.fixture.spec.d.ts +1 -0
- package/dist/src/benchmark.composed.fixture.spec.js +52 -0
- package/dist/src/benchmark.composed.fixture.spec.js.map +1 -0
- package/dist/src/benchmark.composed.runner.d.ts +14 -0
- package/dist/src/benchmark.composed.runner.js +197 -0
- package/dist/src/benchmark.composed.runner.js.map +1 -0
- package/dist/src/benchmark.composed.two.fixture.d.ts +5 -0
- package/dist/src/benchmark.composed.two.fixture.js +118 -0
- package/dist/src/benchmark.composed.two.fixture.js.map +1 -0
- package/dist/src/benchmark.configuration.d.ts +19 -0
- package/dist/src/benchmark.configuration.js +111 -0
- package/dist/src/benchmark.configuration.js.map +1 -0
- package/dist/src/benchmark.configuration.spec.d.ts +1 -0
- package/dist/src/benchmark.configuration.spec.js +28 -0
- package/dist/src/benchmark.configuration.spec.js.map +1 -0
- package/dist/src/benchmark.dependencies.d.ts +37 -0
- package/dist/src/benchmark.dependencies.js +3 -0
- package/dist/src/benchmark.dependencies.js.map +1 -0
- package/dist/src/benchmark.engine.d.ts +31 -0
- package/dist/src/benchmark.engine.js +47 -0
- package/dist/src/benchmark.engine.js.map +1 -0
- package/dist/src/benchmark.engine.spec.d.ts +1 -0
- package/dist/src/benchmark.engine.spec.js +116 -0
- package/dist/src/benchmark.engine.spec.js.map +1 -0
- package/dist/src/benchmark.execution.d.ts +22 -0
- package/dist/src/benchmark.execution.js +64 -0
- package/dist/src/benchmark.execution.js.map +1 -0
- package/dist/src/benchmark.execution.spec.d.ts +1 -0
- package/dist/src/benchmark.execution.spec.js +74 -0
- package/dist/src/benchmark.execution.spec.js.map +1 -0
- package/dist/src/benchmark.format.fixture.d.ts +26 -0
- package/dist/src/benchmark.format.fixture.js +186 -0
- package/dist/src/benchmark.format.fixture.js.map +1 -0
- package/dist/src/benchmark.format.oracle.d.ts +8 -0
- package/dist/src/benchmark.format.oracle.js +30 -0
- package/dist/src/benchmark.format.oracle.js.map +1 -0
- package/dist/src/benchmark.format.runner.d.ts +8 -0
- package/dist/src/benchmark.format.runner.js +202 -0
- package/dist/src/benchmark.format.runner.js.map +1 -0
- package/dist/src/benchmark.format.source.d.ts +5 -0
- package/dist/src/benchmark.format.source.js +16 -0
- package/dist/src/benchmark.format.source.js.map +1 -0
- package/dist/src/benchmark.gc.d.ts +39 -0
- package/dist/src/benchmark.gc.js +83 -0
- package/dist/src/benchmark.gc.js.map +1 -0
- package/dist/src/benchmark.gc.spec.d.ts +1 -0
- package/dist/src/benchmark.gc.spec.js +50 -0
- package/dist/src/benchmark.gc.spec.js.map +1 -0
- package/dist/src/benchmark.history.d.ts +15 -0
- package/dist/src/benchmark.history.js +71 -0
- package/dist/src/benchmark.history.js.map +1 -0
- package/dist/src/benchmark.init.d.ts +6 -0
- package/dist/src/benchmark.init.js +34 -0
- package/dist/src/benchmark.init.js.map +1 -0
- package/dist/src/benchmark.measurement.d.ts +15 -0
- package/dist/src/benchmark.measurement.js +15 -0
- package/dist/src/benchmark.measurement.js.map +1 -0
- package/dist/src/benchmark.options.d.ts +29 -0
- package/dist/src/benchmark.options.js +53 -0
- package/dist/src/benchmark.options.js.map +1 -0
- package/dist/src/benchmark.periodic.fixture.d.ts +5 -0
- package/dist/src/benchmark.periodic.fixture.js +71 -0
- package/dist/src/benchmark.periodic.fixture.js.map +1 -0
- package/dist/src/benchmark.periodic.fixture.spec.d.ts +1 -0
- package/dist/src/benchmark.periodic.fixture.spec.js +97 -0
- package/dist/src/benchmark.periodic.fixture.spec.js.map +1 -0
- package/dist/src/benchmark.profile.d.ts +9 -0
- package/dist/src/benchmark.profile.js +68 -0
- package/dist/src/benchmark.profile.js.map +1 -0
- package/dist/src/benchmark.profile.spec.d.ts +1 -0
- package/dist/src/benchmark.profile.spec.js +65 -0
- package/dist/src/benchmark.profile.spec.js.map +1 -0
- package/dist/src/benchmark.record.d.ts +16 -0
- package/dist/src/benchmark.record.js +34 -0
- package/dist/src/benchmark.record.js.map +1 -0
- package/dist/src/benchmark.report.d.ts +131 -0
- package/dist/src/benchmark.report.edges.spec.d.ts +1 -0
- package/dist/src/benchmark.report.edges.spec.js +25 -0
- package/dist/src/benchmark.report.edges.spec.js.map +1 -0
- package/dist/src/benchmark.report.js +372 -0
- package/dist/src/benchmark.report.js.map +1 -0
- package/dist/src/benchmark.report.spec.d.ts +1 -0
- package/dist/src/benchmark.report.spec.js +304 -0
- package/dist/src/benchmark.report.spec.js.map +1 -0
- package/dist/src/benchmark.runner.d.ts +30 -0
- package/dist/src/benchmark.runner.js +257 -0
- package/dist/src/benchmark.runner.js.map +1 -0
- package/dist/src/benchmark.state.digest.d.ts +7 -0
- package/dist/src/benchmark.state.digest.js +28 -0
- package/dist/src/benchmark.state.digest.js.map +1 -0
- package/dist/src/benchmark.state.digest.spec.d.ts +1 -0
- package/dist/src/benchmark.state.digest.spec.js +30 -0
- package/dist/src/benchmark.state.digest.spec.js.map +1 -0
- package/index.ts +10 -0
- package/package.json +81 -3
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyComposedBenchmark = verifyComposedBenchmark;
|
|
4
|
+
exports.runComposedBenchmark = runComposedBenchmark;
|
|
5
|
+
const files_node_1 = require("@cobol-ts/files-node");
|
|
6
|
+
const benchmark_state_digest_1 = require("./benchmark.state.digest");
|
|
7
|
+
const files_node_2 = require("@cobol-ts/files-node");
|
|
8
|
+
const benchmark_runner_1 = require("./benchmark.runner");
|
|
9
|
+
const plan_graph_1 = require("@cobol-ts/plan_graph");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const node_perf_hooks_1 = require("node:perf_hooks");
|
|
12
|
+
const benchmark_report_1 = require("./benchmark.report");
|
|
13
|
+
const composition_definition_1 = require("@cobol-ts/composition-definition");
|
|
14
|
+
const cursor_loader_indexed_graph_state_node_1 = require("@cobol-ts/cursor-loader-indexed-graph-state-node");
|
|
15
|
+
const cel_graph_runtime_1 = require("@cobol-ts/cel-graph-runtime");
|
|
16
|
+
const errors_1 = require("@cobol-ts/errors");
|
|
17
|
+
const yaml_jsyaml_1 = require("@cobol-ts/yaml-jsyaml");
|
|
18
|
+
const benchmark_format_fixture_1 = require("./benchmark.format.fixture");
|
|
19
|
+
const benchmark_format_oracle_1 = require("./benchmark.format.oracle");
|
|
20
|
+
const { readFile } = files_node_2.nodeLocalFiles.promises;
|
|
21
|
+
async function benchmarkComposition(configDirectory) {
|
|
22
|
+
return (0, benchmark_runner_1.parseBenchmarkConfiguration)(await readFile((0, node_path_1.join)(configDirectory, 'benchmark.yaml'), 'utf8')).composition;
|
|
23
|
+
}
|
|
24
|
+
/** All timed composition passes go through the normal CLI's composed CEL executor.
|
|
25
|
+
* Related-source counts are inspected separately, outside the timed pass. */
|
|
26
|
+
async function productionPass(dependencies, paths, input, limit) {
|
|
27
|
+
const configDirectory = paths.directory;
|
|
28
|
+
const compositionName = await benchmarkComposition(configDirectory);
|
|
29
|
+
const definition = (0, errors_1.valueOrThrow)(await (0, composition_definition_1.readCompositionDefinition)(yaml_jsyaml_1.jsYamlParser, configDirectory, 'files.yaml', compositionName, files_node_1.nodeTextFiles));
|
|
30
|
+
const composition = await dependencies.prepareConfiguredComposition(paths, definition, input);
|
|
31
|
+
const authored = (0, errors_1.valueOrThrow)((0, cel_graph_runtime_1.parseAuthoringGraph)(await readFile((0, node_path_1.join)(configDirectory, 'graph.yaml'), 'utf8'), yaml_jsyaml_1.jsYamlParser));
|
|
32
|
+
const nodes = Object.keys(authored).length;
|
|
33
|
+
const twoFile = composition.sources.some(source => source.name === 'accounts');
|
|
34
|
+
const relatedSource = composition.sources.findIndex(source => source.name === (twoFile ? 'accounts' : 'indexed'));
|
|
35
|
+
if (relatedSource < 0)
|
|
36
|
+
throw new Error('Composed benchmark is missing its related child source');
|
|
37
|
+
let relatedRows = 0, customersWithRelated = 0, counted = 0;
|
|
38
|
+
await composition.composed.scan(row => {
|
|
39
|
+
const childCount = row.count(relatedSource);
|
|
40
|
+
relatedRows += childCount;
|
|
41
|
+
if (childCount > 0)
|
|
42
|
+
customersWithRelated++;
|
|
43
|
+
return ++counted < limit;
|
|
44
|
+
});
|
|
45
|
+
if (counted !== limit)
|
|
46
|
+
throw new Error(`Composed source ended early: ${counted}/${limit}`);
|
|
47
|
+
const state = (0, benchmark_state_digest_1.benchmarkStateDigest)(nodes);
|
|
48
|
+
const started = node_perf_hooks_1.performance.now();
|
|
49
|
+
const measurement = await dependencies.executeProductionCel(paths.projectRoot, limit, { composition: compositionName, resolveInput: input,
|
|
50
|
+
onIndexed: state.observe
|
|
51
|
+
});
|
|
52
|
+
const milliseconds = node_perf_hooks_1.performance.now() - started;
|
|
53
|
+
if (state.records !== limit || measurement.records !== limit)
|
|
54
|
+
throw new Error(`Composed execution ended early: ${state.records}/${limit}`);
|
|
55
|
+
return { records: limit, nodes, milliseconds, throughput: 1000 * limit / milliseconds,
|
|
56
|
+
digest: state.digest, relatedRows, customersWithRelated,
|
|
57
|
+
...(measurement.referenceLoad ? { referenceLoad: measurement.referenceLoad } : {}) };
|
|
58
|
+
}
|
|
59
|
+
/** One pass re-opens every input and the original read-only historical file. */
|
|
60
|
+
async function verifyIndexedPass(dependencies, paths, input, limit) {
|
|
61
|
+
const configDirectory = paths.directory;
|
|
62
|
+
const compositionName = await benchmarkComposition(configDirectory);
|
|
63
|
+
const definition = (0, errors_1.valueOrThrow)(await (0, composition_definition_1.readCompositionDefinition)(yaml_jsyaml_1.jsYamlParser, configDirectory, 'files.yaml', compositionName, files_node_1.nodeTextFiles));
|
|
64
|
+
const config = (0, errors_1.valueOrThrow)(yaml_jsyaml_1.jsYamlParser.parse(await readFile((0, node_path_1.join)(configDirectory, 'benchmark.yaml'), 'utf8')));
|
|
65
|
+
if (typeof config !== 'object' || config === null || !('records' in config) ||
|
|
66
|
+
!Number.isSafeInteger(config.records) || typeof config.records !== 'number' ||
|
|
67
|
+
limit > config.records)
|
|
68
|
+
throw new Error('Composed benchmark limit exceeds its generated record count');
|
|
69
|
+
const available = config.records;
|
|
70
|
+
const composition = await dependencies.prepareConfiguredComposition(paths, definition, input);
|
|
71
|
+
const authored = (0, errors_1.valueOrThrow)((0, cel_graph_runtime_1.parseAuthoringGraph)(await readFile((0, node_path_1.join)(configDirectory, 'graph.yaml'), 'utf8'), yaml_jsyaml_1.jsYamlParser));
|
|
72
|
+
const indexed = (0, errors_1.valueOrThrow)((0, cel_graph_runtime_1.prepareCelGraph)(authored, composition.composed.projection, composition.access, {}, {}, (0, plan_graph_1.createAlwaysPlanner)()));
|
|
73
|
+
const schema = indexed.schema;
|
|
74
|
+
// Prepare the authored-node identity for each topologically sorted execution slot once.
|
|
75
|
+
const authoredIndexBySlot = schema.nodes.map(node => {
|
|
76
|
+
const match = /^node(\d{4})$/.exec(node.name);
|
|
77
|
+
const authoredIndex = match === null ? -1 : Number(match[1]);
|
|
78
|
+
if (authoredIndex < 0 || authoredIndex >= schema.nodes.length)
|
|
79
|
+
throw new Error(`Unexpected benchmark graph node ${node.name}`);
|
|
80
|
+
return authoredIndex;
|
|
81
|
+
});
|
|
82
|
+
const twoFile = composition.sources.some(source => source.name === 'accounts');
|
|
83
|
+
const relatedSource = composition.sources.findIndex(source => source.name === (twoFile ? 'accounts' : 'indexed'));
|
|
84
|
+
if (relatedSource < 0)
|
|
85
|
+
throw new Error('Composed benchmark is missing its related child source');
|
|
86
|
+
const document = await dependencies.readBenchmarkAccumulator(configDirectory);
|
|
87
|
+
const keyNormalizer = dependencies.indexedKeyNormalizer(document.state.customerIdType, document.state.customerId);
|
|
88
|
+
const indexedExecutor = indexed.createExecutor();
|
|
89
|
+
if (schema.nodes.length === 0)
|
|
90
|
+
throw new Error('Composed benchmark requires graph nodes');
|
|
91
|
+
const firstSlot = authoredIndexBySlot.indexOf(0);
|
|
92
|
+
const lastSlot = authoredIndexBySlot.indexOf(schema.nodes.length - 1);
|
|
93
|
+
const canonical = (0, errors_1.valueOrThrow)((0, cel_graph_runtime_1.canonicaliseCelGraph)(authored));
|
|
94
|
+
const validatedInitial = (0, errors_1.valueOrThrow)((0, cel_graph_runtime_1.validateInitialAccumulator)(document.initial, authored, canonical));
|
|
95
|
+
const initial = dependencies.indexedSeedValues(validatedInitial, schema);
|
|
96
|
+
let digest = 0n;
|
|
97
|
+
let count = 0;
|
|
98
|
+
let relatedRows = 0;
|
|
99
|
+
let customersWithRelated = 0;
|
|
100
|
+
const started = node_perf_hooks_1.performance.now();
|
|
101
|
+
const processed = await (0, cursor_loader_indexed_graph_state_node_1.scanIndexedAccumulator)(composition.composed, {
|
|
102
|
+
schema, optional: document.state.optional, removed: document.state.removed,
|
|
103
|
+
customerIdType: document.state.customerIdType, initial,
|
|
104
|
+
...(document.state.file ? { filename: (0, node_path_1.resolve)(configDirectory, document.state.file) } : {})
|
|
105
|
+
}, row => keyNormalizer(row.key), (row, state) => {
|
|
106
|
+
if (count >= limit)
|
|
107
|
+
return false;
|
|
108
|
+
const childCount = row.count(relatedSource);
|
|
109
|
+
relatedRows += childCount;
|
|
110
|
+
if (childCount > 0)
|
|
111
|
+
customersWithRelated++;
|
|
112
|
+
const expectedChildren = count % 2 === 0 ? Math.min(2, available - count) : 0;
|
|
113
|
+
if (childCount !== expectedChildren)
|
|
114
|
+
throw new Error(`${twoFile ? 'Incorrect related account count' : 'Incorrect mapped account count'} at customer ${row.key}: ${childCount} != ${expectedChildren}`);
|
|
115
|
+
indexedExecutor(row, state, {}, []);
|
|
116
|
+
const left = state.values[firstSlot];
|
|
117
|
+
const right = state.values[lastSlot];
|
|
118
|
+
if (typeof left !== 'bigint' || typeof right !== 'bigint')
|
|
119
|
+
throw new Error('Expected integer accumulator results');
|
|
120
|
+
const input = (0, benchmark_format_fixture_1.scalarRow)(count);
|
|
121
|
+
if (row.key !== Number(input.customerId))
|
|
122
|
+
throw new Error(`Incorrect merge key at customer ${count + 1}`);
|
|
123
|
+
const expected = (0, benchmark_format_oracle_1.expectedInitialFormatState)(input.customerId, schema.nodes.length);
|
|
124
|
+
// Independently evaluate the generated graph using authored node identity.
|
|
125
|
+
for (let i = 0; i < expected.length; i++) {
|
|
126
|
+
const block = i % 10;
|
|
127
|
+
let increase = block === 0 ? input.amountA + input.amountB :
|
|
128
|
+
block === 1 ? (input.statusCode === 'A' ? 1n : 0n) :
|
|
129
|
+
block === 2 ? input.amountA : block === 3 ? input.amountB : 1n;
|
|
130
|
+
if (block === 4 && count % 2 === 0) {
|
|
131
|
+
// Account rows 2*j and 2*j+1 belong to odd customer 2*j+1.
|
|
132
|
+
increase += (0, benchmark_format_fixture_1.scalarRow)(count).amountA;
|
|
133
|
+
if (count + 1 < available)
|
|
134
|
+
increase += (0, benchmark_format_fixture_1.scalarRow)(count + 1).amountA;
|
|
135
|
+
}
|
|
136
|
+
if (i > 0 && block === 0 && expected[i - 1] > 0n)
|
|
137
|
+
increase += 1n;
|
|
138
|
+
expected[i] = expected[i] + increase;
|
|
139
|
+
}
|
|
140
|
+
// Indexed state slots follow topological order. The oracle follows authored names.
|
|
141
|
+
for (let i = 0; i < schema.nodes.length; i++) {
|
|
142
|
+
const name = schema.nodes[i].name;
|
|
143
|
+
const wanted = expected[authoredIndexBySlot[i]];
|
|
144
|
+
const actual = state.values[i];
|
|
145
|
+
if (actual !== wanted)
|
|
146
|
+
throw new Error(`Incorrect indexed node ${name} at customer ${row.key}: ${String(actual)} != ${String(wanted)}`);
|
|
147
|
+
}
|
|
148
|
+
digest = (digest * 1099511628211n + 31n * left + right + BigInt(state.customerId)) & 0xffffffffffffffffn;
|
|
149
|
+
count++;
|
|
150
|
+
return count < limit;
|
|
151
|
+
});
|
|
152
|
+
if (processed !== limit || count !== limit)
|
|
153
|
+
throw new Error(`Composed benchmark read ${count} customers, expected ${limit}`);
|
|
154
|
+
const milliseconds = node_perf_hooks_1.performance.now() - started;
|
|
155
|
+
return { records: count, nodes: schema.nodes.length, milliseconds,
|
|
156
|
+
throughput: 1000 * count / milliseconds, digest: '0x' + digest.toString(16).padStart(16, '0'),
|
|
157
|
+
relatedRows, customersWithRelated };
|
|
158
|
+
}
|
|
159
|
+
async function verifyComposedBenchmark(dependencies, directory, limit) {
|
|
160
|
+
const indexed = await dependencies.withBenchmarkSources(directory, (paths, input) => verifyIndexedPass(dependencies, paths, input, limit));
|
|
161
|
+
return `VERIFIED composition records=${limit} nodes=${indexed.nodes} sources=${await composedSourceCount(directory)} mappedRows=${indexed.relatedRows} customersWithAccounts=${indexed.customersWithRelated} digest=${indexed.digest}`;
|
|
162
|
+
}
|
|
163
|
+
async function runComposedBenchmark(dependencies, directory, records, runs, emit) {
|
|
164
|
+
if (!Number.isSafeInteger(records) || records < 1)
|
|
165
|
+
throw new Error('Composed records must be a positive integer');
|
|
166
|
+
if (!Number.isSafeInteger(runs) || runs < 1)
|
|
167
|
+
throw new Error('Composed runs must be a positive integer');
|
|
168
|
+
return dependencies.withBenchmarkSources(directory, (paths, input) => runConfiguredComposedBenchmark(dependencies, paths, input, records, runs, emit));
|
|
169
|
+
}
|
|
170
|
+
async function runConfiguredComposedBenchmark(dependencies, paths, input, records, runs, emit) {
|
|
171
|
+
// Correctness is independent of throughput; warm up before timed passes.
|
|
172
|
+
const warmup = Math.min(1000, records);
|
|
173
|
+
await productionPass(dependencies, paths, input, warmup);
|
|
174
|
+
const passes = [];
|
|
175
|
+
for (let i = 0; i < runs; i++) {
|
|
176
|
+
const result = await productionPass(dependencies, paths, input, records);
|
|
177
|
+
passes.push(result);
|
|
178
|
+
if (result.referenceLoad)
|
|
179
|
+
emit((0, benchmark_report_1.formatReferenceLoad)(result.referenceLoad, `pass=${i + 1} included-in-total`));
|
|
180
|
+
emit(`PASS ${i + 1} composition=indexed nodes=${result.nodes} customers=${result.records} mappedRows=${result.relatedRows} customersWithAccounts=${result.customersWithRelated} rec/s=${Math.round(result.throughput)} digest=${result.digest}`);
|
|
181
|
+
}
|
|
182
|
+
if (passes.some(result => result.digest !== passes[0]?.digest))
|
|
183
|
+
throw new Error('Composed benchmark state digest changed between runs');
|
|
184
|
+
const sorted = passes.map(result => result.throughput).sort((a, b) => a - b);
|
|
185
|
+
emit(`SUMMARY composition=indexed nodes=${passes[0].nodes} customers=${records} mappedRows=${passes[0].relatedRows} customersWithAccounts=${passes[0].customersWithRelated} median=${Math.round(sorted[Math.floor(sorted.length / 2)])} rec/s`);
|
|
186
|
+
return passes;
|
|
187
|
+
}
|
|
188
|
+
/** Kept out of the timed scan and used only for verification reporting. */
|
|
189
|
+
async function composedSourceCount(directory) {
|
|
190
|
+
const configDirectory = (0, node_path_1.join)((0, node_path_1.resolve)(directory), '.cobolts');
|
|
191
|
+
const compositionName = await benchmarkComposition(configDirectory);
|
|
192
|
+
const definition = (0, errors_1.valueOrThrow)(await (0, composition_definition_1.readCompositionDefinition)(yaml_jsyaml_1.jsYamlParser, configDirectory, 'files.yaml', compositionName, files_node_1.nodeTextFiles));
|
|
193
|
+
if (definition.type !== 'relational')
|
|
194
|
+
throw new Error(`Benchmark composition ${compositionName} is not relational`);
|
|
195
|
+
return Object.keys(definition.composition.files).length;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=benchmark.composed.runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.composed.runner.js","sourceRoot":"","sources":["../../src/benchmark.composed.runner.ts"],"names":[],"mappings":";;AAgKA,0DAGC;AAED,oDAKC;AA1KD,qDAAkD;AAElD,qEAA6D;AAC7D,qDAAmD;AACnD,yDAA+D;AAC/D,qDAAwD;AACxD,yCAAuC;AACvC,qDAA4C;AAC5C,yDAAsD;AACtD,6EAAyG;AAEzG,6GAAwF;AACxF,mEAAgI;AAChI,6CAA8C;AAC9C,uDAAmD;AACnD,yEAAqD;AACrD,uEAAqE;AAErE,MAAM,EAAC,QAAQ,EAAC,GAAG,2BAAc,CAAC,QAAQ,CAAA;AAG1C,KAAK,UAAU,oBAAoB,CAAC,eAAsB;IACtD,OAAO,IAAA,8CAA2B,EAAC,MAAM,QAAQ,CAAC,IAAA,gBAAI,EAAC,eAAe,EAAC,gBAAgB,CAAC,EAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;AAClH,CAAC;AAYD;6EAC6E;AAC7E,KAAK,UAAU,cAAc,CAAC,YAAmC,EAAE,KAAe,EAAE,KAAmB,EAAE,KAAa;IAClH,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAA;IACvC,MAAM,eAAe,GAAC,MAAM,oBAAoB,CAAC,eAAe,CAAC,C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AAC,MAAM,GAAC,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,CAAC;IAClP,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,2EAA2E;AAC3E,KAAK,UAAU,mBAAmB,CAAC,SAAgB;IAC/C,MAAM,eAAe,GAAC,IAAA,gBAAI,EAAC,IAAA,mBAAO,EAAC,SAAS,CAAC,EAAC,UAAU,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAC,MAAM,oBAAoB,CAAC,eAAe,CAAC,CAAC;IAClE,MAAM,UAAU,GAAC,IAAA,qBAAY,EAAC,MAAM,IAAA,kDAAyB,EAAC,0BAAY,EAAC,eAAe,EAAC,YAAY,EAAC,eAAe,EAAC,0BAAa,CAAC,CAAC,CAAC;IACxI,IAAG,UAAU,CAAC,IAAI,KAAG,YAAY;QAAC,MAAM,IAAI,KAAK,CAAC,yBAAyB,eAAe,oBAAoB,CAAC,CAAC;IAChH,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A second physical input: one account per source row, grouped by customer key.
|
|
2
|
+
* Half the customers have no accounts; the other half have two (the final
|
|
3
|
+
* customer has one when the input size is odd). No mapping file is involved. */
|
|
4
|
+
export declare function twoFileGraphYaml(nodes: 10 | 1000): string;
|
|
5
|
+
export declare function generateTwoFileBenchmark(base: string, records: number, nodes: 10 | 1000, force: boolean): Promise<string>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.twoFileGraphYaml = twoFileGraphYaml;
|
|
4
|
+
exports.generateTwoFileBenchmark = generateTwoFileBenchmark;
|
|
5
|
+
const cursor_loader_benchmark_1 = require("@cobol-ts/cursor-loader-benchmark");
|
|
6
|
+
const files_node_1 = require("@cobol-ts/files-node");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const benchmark_format_fixture_1 = require("./benchmark.format.fixture");
|
|
9
|
+
const { mkdir, open, stat, writeFile } = files_node_1.nodeLocalFiles.promises;
|
|
10
|
+
/** A second physical input: one account per source row, grouped by customer key.
|
|
11
|
+
* Half the customers have no accounts; the other half have two (the final
|
|
12
|
+
* customer has one when the input size is odd). No mapping file is involved. */
|
|
13
|
+
function twoFileGraphYaml(nodes) {
|
|
14
|
+
let index = -1;
|
|
15
|
+
return (0, benchmark_format_fixture_1.formatGraphYaml)(nodes).split('\n').map(line => {
|
|
16
|
+
if (/^node\d{4}:$/.test(line))
|
|
17
|
+
index++;
|
|
18
|
+
if (!line.startsWith(' cel: '))
|
|
19
|
+
return line;
|
|
20
|
+
const expression = JSON.parse(line.slice(' cel: '.length));
|
|
21
|
+
const translated = expression.replace(/input\.(amountA|amountB|statusCode|customerId)/g, 'input.cobol.$1');
|
|
22
|
+
return ' cel: ' + JSON.stringify(index % 10 === 4
|
|
23
|
+
? translated + ' + input.accounts.map(a, a.amountA).sum()'
|
|
24
|
+
: translated);
|
|
25
|
+
}).join('\n');
|
|
26
|
+
}
|
|
27
|
+
async function generateTwoFileBenchmark(base, records, nodes, force) {
|
|
28
|
+
if (!Number.isSafeInteger(records) || records < 1)
|
|
29
|
+
throw new Error('Records must be a positive integer');
|
|
30
|
+
const destination = (0, node_path_1.resolve)(base, 'format-composed-two');
|
|
31
|
+
if (!force) {
|
|
32
|
+
try {
|
|
33
|
+
await stat(destination);
|
|
34
|
+
throw new Error(`Benchmark project already exists: ${destination}`);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (!error || typeof error !== 'object' || !('code' in error) || error.code !== 'ENOENT')
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const folder = (0, node_path_1.join)(destination, '.cobolts');
|
|
42
|
+
const data = (0, node_path_1.join)(destination, 'data');
|
|
43
|
+
await mkdir(folder, { recursive: true });
|
|
44
|
+
await mkdir(data, { recursive: true });
|
|
45
|
+
const put = (name, contents) => writeFile((0, node_path_1.join)(folder, name), contents, { flag: force ? 'w' : 'wx' });
|
|
46
|
+
await writeFile((0, node_path_1.join)(destination, '.gitignore'), ' *\n'.trimStart() + '!.gitignore\n', { flag: force ? 'w' : 'wx' });
|
|
47
|
+
const file = await open((0, node_path_1.join)(data, 'accounts.csv'), force ? 'w' : 'wx');
|
|
48
|
+
try {
|
|
49
|
+
await file.writeFile('customerId,accountId,amountA\n');
|
|
50
|
+
for (let from = 0; from < records; from += 5000) {
|
|
51
|
+
const rows = [];
|
|
52
|
+
for (let i = from; i < Math.min(records, from + 5000); i++) {
|
|
53
|
+
const customerId = 2 * Math.floor(i / 2) + 1;
|
|
54
|
+
rows.push(`${customerId},${i + 1},${(0, benchmark_format_fixture_1.scalarRow)(i).amountA}\n`);
|
|
55
|
+
}
|
|
56
|
+
await file.writeFile(rows.join(''));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
await file.close();
|
|
61
|
+
}
|
|
62
|
+
await put('files.yaml', `root: ../../format-cobol/copybooks
|
|
63
|
+
entities:
|
|
64
|
+
- customer
|
|
65
|
+
files:
|
|
66
|
+
cobol:
|
|
67
|
+
type: cobol
|
|
68
|
+
key: customer
|
|
69
|
+
keyPath: customerId
|
|
70
|
+
copybook: format.cbl
|
|
71
|
+
options:
|
|
72
|
+
framing:
|
|
73
|
+
kind: fixed
|
|
74
|
+
recordLength: 200
|
|
75
|
+
accounts:
|
|
76
|
+
type: csv
|
|
77
|
+
key: customer
|
|
78
|
+
keyPath: customerId
|
|
79
|
+
projection:
|
|
80
|
+
customerId: {type: integer}
|
|
81
|
+
accountId: {type: integer}
|
|
82
|
+
amountA: {type: integer}
|
|
83
|
+
${cursor_loader_benchmark_1.benchmarkReferenceFile}mappings: {}
|
|
84
|
+
compositions:
|
|
85
|
+
benchmark:
|
|
86
|
+
type: relational
|
|
87
|
+
periodicity: daily
|
|
88
|
+
master: cobol
|
|
89
|
+
files:
|
|
90
|
+
cobol: one
|
|
91
|
+
accounts: manyOptional
|
|
92
|
+
${cursor_loader_benchmark_1.benchmarkReferenceMembership}`);
|
|
93
|
+
await put('data.yaml', `root: ../../
|
|
94
|
+
files:
|
|
95
|
+
cobol: format-cobol/data/records.dat
|
|
96
|
+
accounts: format-composed-two/data/accounts.csv
|
|
97
|
+
sicCodes: format-composed-two/data/sicCodes.csv
|
|
98
|
+
`);
|
|
99
|
+
await writeFile((0, node_path_1.join)(data, 'sicCodes.csv'), cursor_loader_benchmark_1.benchmarkReferenceCsv, { flag: force ? 'w' : 'wx' });
|
|
100
|
+
await put('graph.yaml', twoFileGraphYaml(nodes));
|
|
101
|
+
await put('accumulator.yaml', `file: ../../format-cobol/data/previous-state.igs
|
|
102
|
+
optional: false
|
|
103
|
+
removed: reject
|
|
104
|
+
customerId:
|
|
105
|
+
field: customerId
|
|
106
|
+
type: number
|
|
107
|
+
initial:
|
|
108
|
+
${Array.from({ length: nodes }, (_, i) => ` node${String(i).padStart(4, '0')}: 0\n`).join('')}`);
|
|
109
|
+
await put('benchmark.yaml', `version: 1
|
|
110
|
+
composition: benchmark
|
|
111
|
+
file: cobol
|
|
112
|
+
records: ${records}
|
|
113
|
+
runs: 3
|
|
114
|
+
graph: graph.yaml
|
|
115
|
+
`);
|
|
116
|
+
return destination;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=benchmark.composed.two.fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.composed.two.fixture.js","sourceRoot":"","sources":["../../src/benchmark.composed.two.fixture.ts"],"names":[],"mappings":";;AAUA,4CAWC;AAED,4DA8EC;AArGD,+EAA6H;AAC7H,qDAAmD;AACnD,yCAAuC;AACvC,yEAAqE;AAErE,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,GAAG,2BAAc,CAAC,QAAQ,CAAA;AAE9D;;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AAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACtF,MAAM,GAAG,CAAC,gBAAgB,EAAC;;;WAGpB,OAAO;;;CAGjB,CAAC,CAAC;IACC,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FormatType } from './benchmark.format.fixture';
|
|
2
|
+
export interface BenchmarkConfiguration {
|
|
3
|
+
readonly version: 1;
|
|
4
|
+
readonly file?: string;
|
|
5
|
+
readonly composition: string;
|
|
6
|
+
readonly encoding?: 'ascii' | 'ebcdic-037';
|
|
7
|
+
/** Optional override of the default logical-output mapping: max PIC digits represented as number. */
|
|
8
|
+
readonly maxNumberDigits?: number;
|
|
9
|
+
readonly records?: number;
|
|
10
|
+
readonly warmup: number;
|
|
11
|
+
readonly runs: number;
|
|
12
|
+
readonly fields: readonly string[];
|
|
13
|
+
readonly graph?: string;
|
|
14
|
+
/** Applies to legacy graph projects; CLI override takes precedence. */
|
|
15
|
+
readonly formatComparison?: FormatType;
|
|
16
|
+
readonly fixture?: 'baseline' | 'odo';
|
|
17
|
+
}
|
|
18
|
+
export declare function positiveBenchmarkInteger(value: unknown, name: string, zero?: boolean): number;
|
|
19
|
+
export declare function parseBenchmarkConfiguration(source: string, availableCompositions?: readonly string[]): BenchmarkConfiguration;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.positiveBenchmarkInteger = positiveBenchmarkInteger;
|
|
4
|
+
exports.parseBenchmarkConfiguration = parseBenchmarkConfiguration;
|
|
5
|
+
const yaml_jsyaml_1 = require("@cobol-ts/yaml-jsyaml");
|
|
6
|
+
function record(value) {
|
|
7
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function positiveBenchmarkInteger(value, name, zero = false) {
|
|
10
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < (zero ? 0 : 1))
|
|
11
|
+
throw new Error(`benchmark.yaml: ${name} must be ${zero ? 'a nonnegative' : 'a positive'} integer`);
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
function parseMapping(source) {
|
|
15
|
+
const parsed = yaml_jsyaml_1.jsYamlParser.parse(source);
|
|
16
|
+
if ('errors' in parsed)
|
|
17
|
+
throw new Error(parsed.errors.join('\n'));
|
|
18
|
+
const yaml = parsed.value;
|
|
19
|
+
if (!record(yaml))
|
|
20
|
+
throw new Error('benchmark.yaml: Expected a mapping');
|
|
21
|
+
if (yaml.version !== 1)
|
|
22
|
+
throw new Error('benchmark.yaml: version must be 1');
|
|
23
|
+
return yaml;
|
|
24
|
+
}
|
|
25
|
+
function parseFile(yaml) {
|
|
26
|
+
const { file, fixture, formatComparison } = yaml;
|
|
27
|
+
if (file !== undefined && (typeof file !== 'string' || !file.trim()))
|
|
28
|
+
throw new Error('benchmark.yaml: file must be a logical file name');
|
|
29
|
+
if (file === undefined && (fixture !== undefined || formatComparison !== undefined))
|
|
30
|
+
throw new Error('benchmark.yaml: file is required for fixture verification');
|
|
31
|
+
return typeof file === 'string' ? { file } : {};
|
|
32
|
+
}
|
|
33
|
+
function parseComposition(value, availableCompositions) {
|
|
34
|
+
const available = availableCompositions?.length
|
|
35
|
+
? `Available compositions in files.yaml: ${availableCompositions.join(', ')}`
|
|
36
|
+
: 'Select a named composition in files.yaml';
|
|
37
|
+
if (value === undefined)
|
|
38
|
+
throw new Error(`benchmark.yaml: composition is required. ${available}`);
|
|
39
|
+
if (typeof value !== 'string' || !/^[A-Za-z][A-Za-z0-9_-]*$/.test(value))
|
|
40
|
+
throw new Error(`benchmark.yaml: invalid composition ${JSON.stringify(value)}. ${available}`);
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
function parseFields(value) {
|
|
44
|
+
if (value !== undefined && (!Array.isArray(value) ||
|
|
45
|
+
value.some(field => typeof field !== 'string' || !field.trim())))
|
|
46
|
+
throw new Error('benchmark.yaml: fields must be a list of property paths');
|
|
47
|
+
return (value ?? []);
|
|
48
|
+
}
|
|
49
|
+
function parseEncoding(value) {
|
|
50
|
+
if (value === undefined)
|
|
51
|
+
return {};
|
|
52
|
+
if (value !== 'ascii' && value !== 'ebcdic-037')
|
|
53
|
+
throw new Error('benchmark.yaml: encoding must be ascii or ebcdic-037');
|
|
54
|
+
return { encoding: value };
|
|
55
|
+
}
|
|
56
|
+
function parseMaxNumberDigits(value) {
|
|
57
|
+
if (value === undefined)
|
|
58
|
+
return {};
|
|
59
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value < 0 || value > 15)
|
|
60
|
+
throw new Error('benchmark.yaml: maxNumberDigits must be an integer from 0 to 15');
|
|
61
|
+
return { maxNumberDigits: value };
|
|
62
|
+
}
|
|
63
|
+
function parseFixture(value) {
|
|
64
|
+
if (value === undefined)
|
|
65
|
+
return {};
|
|
66
|
+
if (value !== 'baseline' && value !== 'odo')
|
|
67
|
+
throw new Error('benchmark.yaml: fixture must be baseline or odo');
|
|
68
|
+
return { fixture: value };
|
|
69
|
+
}
|
|
70
|
+
function parseFormatComparison(value) {
|
|
71
|
+
if (value !== undefined && !['cobol', 'csv', 'jsonl', 'protobuf', 'indexed-graph-state'].includes(String(value)))
|
|
72
|
+
throw new Error('benchmark.yaml: unsupported formatComparison');
|
|
73
|
+
return typeof value === 'string' ? { formatComparison: value } : {};
|
|
74
|
+
}
|
|
75
|
+
function validateAccumulatorStrategy(yaml) {
|
|
76
|
+
if ('accumulatorStrategy' in yaml && yaml.accumulatorStrategy !== 'indexed')
|
|
77
|
+
throw new Error('benchmark.yaml: accumulatorStrategy is obsolete; remove it (indexed per-entity state is the only supported representation)');
|
|
78
|
+
}
|
|
79
|
+
function parseGraph(value) {
|
|
80
|
+
if (value === undefined)
|
|
81
|
+
return {};
|
|
82
|
+
if (value !== 'graph.yaml')
|
|
83
|
+
throw new Error('benchmark.yaml: graph must be graph.yaml, the same graph used by cel execute');
|
|
84
|
+
return { graph: value };
|
|
85
|
+
}
|
|
86
|
+
function parseRecordCount(yaml) {
|
|
87
|
+
return yaml.records !== undefined || yaml.file !== undefined
|
|
88
|
+
? { records: positiveBenchmarkInteger(yaml.records, 'records') }
|
|
89
|
+
: {};
|
|
90
|
+
}
|
|
91
|
+
function parseBenchmarkConfiguration(source, availableCompositions) {
|
|
92
|
+
const yaml = parseMapping(source);
|
|
93
|
+
// Preserve validation precedence before checking numeric run settings.
|
|
94
|
+
const file = parseFile(yaml);
|
|
95
|
+
const composition = parseComposition(yaml.composition, availableCompositions);
|
|
96
|
+
const fields = parseFields(yaml.fields);
|
|
97
|
+
const encoding = parseEncoding(yaml.encoding);
|
|
98
|
+
const maxNumberDigits = parseMaxNumberDigits(yaml.maxNumberDigits);
|
|
99
|
+
const fixture = parseFixture(yaml.fixture);
|
|
100
|
+
const formatComparison = parseFormatComparison(yaml.formatComparison);
|
|
101
|
+
validateAccumulatorStrategy(yaml);
|
|
102
|
+
const graph = parseGraph(yaml.graph);
|
|
103
|
+
return {
|
|
104
|
+
version: 1, composition, ...file, ...encoding, ...maxNumberDigits,
|
|
105
|
+
...parseRecordCount(yaml),
|
|
106
|
+
warmup: positiveBenchmarkInteger(yaml.warmup ?? 0, 'warmup', true),
|
|
107
|
+
runs: positiveBenchmarkInteger(yaml.runs ?? 3, 'runs'),
|
|
108
|
+
fields, ...graph, ...formatComparison, ...fixture
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=benchmark.configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.configuration.js","sourceRoot":"","sources":["../../src/benchmark.configuration.ts"],"names":[],"mappings":";;AAwBA,4DAIC;AAkFD,kEAmBC;AAhID,uDAAkD;AAmBlD,SAAS,MAAM,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK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K,CAAC,CAAA;IACpC,OAAO;QACH,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE,GAAG,eAAe;QACjE,GAAG,gBAAgB,CAAC,IAAI,CAAC;QACzB,MAAM,EAAE,wBAAwB,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;QAClE,IAAI,EAAE,wBAAwB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,MAAM,CAAC;QACtD,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,gBAAgB,EAAE,GAAG,OAAO;KACpD,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const benchmark_configuration_1 = require("./benchmark.configuration");
|
|
4
|
+
describe('benchmark configuration validation order', () => {
|
|
5
|
+
const base = { version: 1, composition: 'benchmark' };
|
|
6
|
+
it('preserves omitted fields and null defaults for composition-only runs', () => {
|
|
7
|
+
const result = (0, benchmark_configuration_1.parseBenchmarkConfiguration)(JSON.stringify({ ...base, warmup: null, runs: null }));
|
|
8
|
+
expect(result).toEqual({ ...base, warmup: 0, runs: 3, fields: [] });
|
|
9
|
+
expect(Object.keys(result)).toEqual(['version', 'composition', 'warmup', 'runs', 'fields']);
|
|
10
|
+
});
|
|
11
|
+
it('checks fixture file requirements before validating the composition', () => {
|
|
12
|
+
expect(() => (0, benchmark_configuration_1.parseBenchmarkConfiguration)(JSON.stringify({ version: 1, fixture: 'bad' })))
|
|
13
|
+
.toThrow('benchmark.yaml: file is required for fixture verification');
|
|
14
|
+
});
|
|
15
|
+
it('checks fields and graph declarations before numeric run settings', () => {
|
|
16
|
+
expect(() => (0, benchmark_configuration_1.parseBenchmarkConfiguration)(JSON.stringify({ ...base, fields: [' '], records: 0, graph: 'other.yaml' })))
|
|
17
|
+
.toThrow('benchmark.yaml: fields must be a list of property paths');
|
|
18
|
+
expect(() => (0, benchmark_configuration_1.parseBenchmarkConfiguration)(JSON.stringify({ ...base, records: 0, graph: 'other.yaml' })))
|
|
19
|
+
.toThrow('benchmark.yaml: graph must be graph.yaml, the same graph used by cel execute');
|
|
20
|
+
});
|
|
21
|
+
it('checks record count before warmup and run count', () => {
|
|
22
|
+
expect(() => (0, benchmark_configuration_1.parseBenchmarkConfiguration)(JSON.stringify({ ...base, file: 'records', warmup: -1, runs: 0 })))
|
|
23
|
+
.toThrow('benchmark.yaml: records must be a positive integer');
|
|
24
|
+
expect(() => (0, benchmark_configuration_1.parseBenchmarkConfiguration)(JSON.stringify({ ...base, warmup: -1, runs: 0 })))
|
|
25
|
+
.toThrow('benchmark.yaml: warmup must be a nonnegative integer');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=benchmark.configuration.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.configuration.spec.js","sourceRoot":"","sources":["../../src/benchmark.configuration.spec.ts"],"names":[],"mappings":";;AAAA,uEAAqE;AAErE,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACtD,MAAM,IAAI,GAAG,EAAC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,EAAC,CAAA;IAEnD,EAAE,CAAC,sEAAsE,EAAE,GAAG,EAAE;QAC5E,MAAM,MAAM,GAAG,IAAA,qDAA2B,EAAC,IAAI,CAAC,SAAS,CAAC,EAAC,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,CAAA;QAC/F,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAC,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC,CAAA;QACj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DAAoD,CAAC,CAAA;QAClE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,qDAA2B,EAAC,IAAI,CAAC,SAAS,CAAC,EAAC,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC;aACpF,OAAO,CAAC,sDAAsD,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CliPaths } from '@cobol-ts/cli-common';
|
|
2
|
+
import type { NamedCompositionDefinition, PreparedConfiguredComposition, ReferenceLoadMeasurement } from '@cobol-ts/composition-definition';
|
|
3
|
+
import type { AccumulatorInitial, CelGraphTimings, NamedAccumulatorValues } from '@cobol-ts/cel-graph-runtime';
|
|
4
|
+
import type { IndexedAccumulatorConfiguration, IndexedGraphSchema, IndexedValue } from '@cobol-ts/cursor-loader-indexed-graph-state';
|
|
5
|
+
export type ResolveInput = (logicalName: string) => Promise<string | undefined>;
|
|
6
|
+
export interface BenchmarkCelMeasurement {
|
|
7
|
+
readonly records: number;
|
|
8
|
+
readonly celMs: number;
|
|
9
|
+
readonly graphTiming?: CelGraphTimings;
|
|
10
|
+
readonly referenceLoad?: ReferenceLoadMeasurement;
|
|
11
|
+
}
|
|
12
|
+
/** Project-specific capabilities injected once by the CLI composition root.
|
|
13
|
+
* Benchmarking uses the real production executor and the same source lifecycle. */
|
|
14
|
+
export interface BenchmarkDependencies {
|
|
15
|
+
readonly withBenchmarkSources: <T>(directory: string, work: (paths: CliPaths, input: ResolveInput) => Promise<T>) => Promise<T>;
|
|
16
|
+
readonly prepareConfiguredComposition: (paths: CliPaths, definition: NamedCompositionDefinition, resolveInput?: ResolveInput) => Promise<PreparedConfiguredComposition<Record<string, unknown>>>;
|
|
17
|
+
readonly readBenchmarkAccumulator: (configDirectory: string) => Promise<{
|
|
18
|
+
readonly state: IndexedAccumulatorConfiguration;
|
|
19
|
+
readonly initial: AccumulatorInitial;
|
|
20
|
+
}>;
|
|
21
|
+
readonly indexedSeedValues: (seed: NamedAccumulatorValues | AccumulatorInitial, schema: IndexedGraphSchema) => Readonly<Record<string, IndexedValue>>;
|
|
22
|
+
readonly indexedKeyNormalizer: (representation: 'number' | 'bigint' | undefined, field: string) => (value: unknown) => number | bigint;
|
|
23
|
+
readonly executeProductionCel: (directory: string, records: number, options: {
|
|
24
|
+
readonly graph?: string;
|
|
25
|
+
readonly composition: string;
|
|
26
|
+
readonly timingSampleEvery?: number;
|
|
27
|
+
readonly resolveInput?: ResolveInput;
|
|
28
|
+
readonly onResult?: (line: string) => void;
|
|
29
|
+
readonly onIndexed?: (entityKey: unknown, values: readonly IndexedValue[], schema: IndexedGraphSchema) => void;
|
|
30
|
+
}) => Promise<BenchmarkCelMeasurement>;
|
|
31
|
+
readonly createProductionCelExecutor: (directory: string, options: {
|
|
32
|
+
readonly graph?: string;
|
|
33
|
+
readonly composition: string;
|
|
34
|
+
readonly onReferenceLoad?: (measurement: ReferenceLoadMeasurement) => void;
|
|
35
|
+
readonly resolveInput?: ResolveInput;
|
|
36
|
+
}) => Promise<(records: number | undefined, timingSampleEvery?: number) => Promise<BenchmarkCelMeasurement>>;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.dependencies.js","sourceRoot":"","sources":["../../src/benchmark.dependencies.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BenchmarkProfile, type MeasurementServices } from './benchmark.measurement';
|
|
2
|
+
import type { TimedPass } from './benchmark.report';
|
|
3
|
+
export interface BenchmarkOperationContext {
|
|
4
|
+
readonly records: number | undefined;
|
|
5
|
+
readonly timingSampleEvery?: number;
|
|
6
|
+
}
|
|
7
|
+
export type BenchmarkOperation = (context: BenchmarkOperationContext) => Promise<TimedPass>;
|
|
8
|
+
export interface NamedBenchmarkOperation {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly execute: BenchmarkOperation;
|
|
11
|
+
readonly timingSampleEvery?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface BenchmarkDefinition {
|
|
14
|
+
readonly records?: number;
|
|
15
|
+
readonly warmup: number;
|
|
16
|
+
readonly runs: number;
|
|
17
|
+
readonly operations: readonly NamedBenchmarkOperation[];
|
|
18
|
+
readonly gc?: boolean;
|
|
19
|
+
readonly profile?: BenchmarkProfile & {
|
|
20
|
+
readonly operation: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface BenchmarkResult {
|
|
24
|
+
readonly operation: string;
|
|
25
|
+
readonly measurement: TimedPass;
|
|
26
|
+
}
|
|
27
|
+
export type BenchmarkRound = readonly BenchmarkResult[];
|
|
28
|
+
export type BenchmarkObserver = (round: BenchmarkRound, index: number, warmup: BenchmarkRound) => void | Promise<void>;
|
|
29
|
+
/** Workloads own their clock and early-termination diagnostics. The engine owns
|
|
30
|
+
* scheduling and instrumentation, not physical data or report formatting. */
|
|
31
|
+
export declare function runBenchmarkDefinition(definition: BenchmarkDefinition, onRound?: BenchmarkObserver, services?: MeasurementServices): Promise<readonly BenchmarkRound[]>;
|