@oxgeneral/orch 0.2.4 → 0.3.0
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/dist/App-TW35IULR.js +18 -0
- package/dist/agent-FRQKL7YI.js +9 -0
- package/dist/{orchestrator-OMU46RCE.js → chunk-2UC4SVJB.js} +190 -53
- package/dist/chunk-2UC4SVJB.js.map +1 -0
- package/dist/chunk-5AJ4LYO5.js +8 -0
- package/dist/{chunk-45K2XID7.js → chunk-6DWHQPTE.js} +2 -1
- package/dist/chunk-6DWHQPTE.js.map +1 -0
- package/dist/{chunk-POUC4CPC.js → chunk-6MJ7V6VY.js} +2 -2
- package/dist/{chunk-HNKJ4IF7.js → chunk-B4JQM4NU.js} +34 -10
- package/dist/chunk-B4JQM4NU.js.map +1 -0
- package/dist/{chunk-6HENRUYZ.js → chunk-CDFA4IIQ.js} +2 -2
- package/dist/chunk-CHRW4CLD.js +2 -0
- package/dist/{chunk-VAAOW526.js → chunk-GZ2Q56YZ.js} +2 -2
- package/dist/{doctor-service-QEJCE5FK.js → chunk-HMMPM7MF.js} +2 -2
- package/dist/{chunk-AELEEEV3.js → chunk-HSBYJ5C5.js} +27 -7
- package/dist/chunk-HXOMNULD.js +2 -0
- package/dist/{chunk-3TGCIXJA.js → chunk-IQXRQBUK.js} +2 -1
- package/dist/chunk-IQXRQBUK.js.map +1 -0
- package/dist/chunk-L26TK7Y5.js +2 -0
- package/dist/chunk-L3FYR45M.js +2 -0
- package/dist/chunk-LXNRCJ22.js +2 -0
- package/dist/{chunk-TX7WOFCW.js → chunk-MGFMVPRD.js} +4 -7
- package/dist/chunk-MGFMVPRD.js.map +1 -0
- package/dist/chunk-MNXU3KCD.js +2 -0
- package/dist/{chunk-CHIP7O6V.js → chunk-O2MSGW3V.js} +3 -1
- package/dist/chunk-O2MSGW3V.js.map +1 -0
- package/dist/chunk-PJ5DKXGR.js +2 -0
- package/dist/{chunk-2KSBOAW3.js → chunk-QEEM67OA.js} +11 -17
- package/dist/chunk-QEEM67OA.js.map +1 -0
- package/dist/chunk-UMZEA3JT.js +5 -0
- package/dist/{shell-OGTSH4RJ.js → chunk-UW6GUUE6.js} +3 -3
- package/dist/chunk-XDVMX2FO.js +8 -0
- package/dist/chunk-XDVMX2FO.js.map +1 -0
- package/dist/chunk-ZA5Z33GO.js +11 -0
- package/dist/claude-E36EGXUV.js +2 -0
- package/dist/{chunk-IRN2U2NE.js → claude-RIB3RQS5.js} +5 -2
- package/dist/claude-RIB3RQS5.js.map +1 -0
- package/dist/cli.js +1 -199
- package/dist/clipboard-service-PDTSZIR5.js +25 -0
- package/dist/codex-OTZKVESD.js +2 -0
- package/dist/{codex-U7LTJTX6.js → codex-VBUSA2GJ.js} +5 -3
- package/dist/codex-VBUSA2GJ.js.map +1 -0
- package/dist/config-CCSS2P7R.js +2 -0
- package/dist/container-OIXLFSX2.js +6 -0
- package/dist/context-GSMQHQES.js +7 -0
- package/dist/cursor-3DJA6LWS.js +2 -0
- package/dist/{cursor-3DI5GKRF.js → cursor-4QIOTDBW.js} +5 -3
- package/dist/cursor-4QIOTDBW.js.map +1 -0
- package/dist/doctor-KBK5JZBZ.js +2 -0
- package/dist/{chunk-K6DMQERQ.js → doctor-service-F2SXDWHS.js} +3 -1
- package/dist/doctor-service-F2SXDWHS.js.map +1 -0
- package/dist/doctor-service-PB7YBH3F.js +2 -0
- package/dist/goal-RFKFPR7M.js +8 -0
- package/dist/index.d.ts +105 -43
- package/dist/index.js +1817 -5
- package/dist/index.js.map +1 -1
- package/dist/init-WRDFAFS2.js +53 -0
- package/dist/logs-5QHJWMEG.js +12 -0
- package/dist/msg-4SCLBO4K.js +9 -0
- package/dist/orchestrator-FGGXK3N3.js +5 -0
- package/dist/{orchestrator-L6QX2LJ7.js.map → orchestrator-FGGXK3N3.js.map} +1 -1
- package/dist/orchestrator-R7IWZUT6.js +13 -0
- package/dist/process-manager-33H27MQF.js +2 -0
- package/dist/process-manager-A36Y7LHP.js +3 -0
- package/dist/{process-manager-TLZOTO4Y.js.map → process-manager-A36Y7LHP.js.map} +1 -1
- package/dist/registry-BO2PPRNG.js +2 -0
- package/dist/registry-JXXRLJ5J.js +3 -0
- package/dist/{registry-UQAHK77P.js.map → registry-JXXRLJ5J.js.map} +1 -1
- package/dist/run-HSHRELOP.js +3 -0
- package/dist/shell-EOJBDWTH.js +2 -0
- package/dist/{chunk-CIIE6LNG.js → shell-IH2MMTVP.js} +3 -2
- package/dist/shell-IH2MMTVP.js.map +1 -0
- package/dist/status-DLBNWSWM.js +2 -0
- package/dist/task-J6ZN7ALI.js +20 -0
- package/dist/team-MSIBKOQC.js +4 -0
- package/dist/template-engine-MFL5B677.js +3 -0
- package/dist/{template-engine-322SCRR6.js.map → template-engine-MFL5B677.js.map} +1 -1
- package/dist/template-engine-ONIDVD4F.js +2 -0
- package/dist/tui-G4XUFAIP.js +2 -0
- package/dist/update-PC2ENCKU.js +2 -0
- package/dist/update-check-HGMBDYHL.js +2 -0
- package/dist/workspace-manager-KOOYTO7E.js +3 -0
- package/dist/{workspace-manager-G5EQRS72.js → workspace-manager-T6AXG7XL.js} +4 -3
- package/dist/workspace-manager-T6AXG7XL.js.map +1 -0
- package/package.json +2 -1
- package/readme.md +5 -4
- package/scripts/benchmark.ts +304 -0
- package/dist/App-KHUT3IV7.js +0 -4962
- package/dist/agent-V5M2C3OC.js +0 -157
- package/dist/chunk-33QNTNR6.js +0 -46
- package/dist/chunk-6HENRUYZ.js.map +0 -1
- package/dist/chunk-AELEEEV3.js.map +0 -1
- package/dist/chunk-ED47GL3F.js +0 -29
- package/dist/chunk-FRTKB575.js +0 -87
- package/dist/chunk-HXYAZGLP.js +0 -15
- package/dist/chunk-I5WEMARW.js +0 -166
- package/dist/chunk-IZYSGYXG.js +0 -2
- package/dist/chunk-IZYSGYXG.js.map +0 -1
- package/dist/chunk-P6ATSXGL.js +0 -107
- package/dist/chunk-PBFE5V3G.js +0 -2
- package/dist/chunk-PBFE5V3G.js.map +0 -1
- package/dist/chunk-PNE6LQRF.js +0 -5
- package/dist/chunk-POUC4CPC.js.map +0 -1
- package/dist/chunk-QTDKQYZI.js +0 -11
- package/dist/chunk-QTDKQYZI.js.map +0 -1
- package/dist/chunk-VAAOW526.js.map +0 -1
- package/dist/chunk-ZTQ3KWXR.js +0 -13
- package/dist/chunk-ZTQ3KWXR.js.map +0 -1
- package/dist/claude-GH6P2DC5.js +0 -4
- package/dist/claude-S47YTIHU.js +0 -2
- package/dist/claude-S47YTIHU.js.map +0 -1
- package/dist/codex-2CH57B7G.js +0 -2
- package/dist/codex-2CH57B7G.js.map +0 -1
- package/dist/config-LJFM55LN.js +0 -75
- package/dist/container-KPH4HVAJ.js +0 -1532
- package/dist/context-EPSDCJTU.js +0 -83
- package/dist/cursor-QFUNKPCQ.js +0 -2
- package/dist/cursor-QFUNKPCQ.js.map +0 -1
- package/dist/doctor-GHRV5I2S.js +0 -67
- package/dist/doctor-service-QEJCE5FK.js.map +0 -1
- package/dist/doctor-service-TPOMFAIG.js +0 -2
- package/dist/goal-I56QP7HS.js +0 -110
- package/dist/init-EQTGQ4G2.js +0 -165
- package/dist/logs-AK255DEJ.js +0 -207
- package/dist/msg-SQWQLJP6.js +0 -95
- package/dist/orchestrator-L6QX2LJ7.js +0 -2
- package/dist/process-manager-HUVNAPQV.js +0 -2
- package/dist/process-manager-TLZOTO4Y.js +0 -2
- package/dist/registry-PQWRVNF2.js +0 -2
- package/dist/registry-UQAHK77P.js +0 -2
- package/dist/run-PSZURVVL.js +0 -95
- package/dist/shell-5ZNXFGXV.js +0 -3
- package/dist/shell-OGTSH4RJ.js.map +0 -1
- package/dist/status-DTF7D3DV.js +0 -56
- package/dist/task-35SDKXFC.js +0 -209
- package/dist/team-AISPLEJB.js +0 -97
- package/dist/template-engine-322SCRR6.js +0 -2
- package/dist/template-engine-3CDRZNMJ.js +0 -3
- package/dist/tui-AR6PVMBQ.js +0 -230
- package/dist/update-DCCWVISK.js +0 -64
- package/dist/update-check-4YKLGBFB.js +0 -2
- package/dist/workspace-manager-AS4TFA7R.js +0 -3
- package/dist/workspace-manager-AS4TFA7R.js.map +0 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Benchmark script for AgentsOrchestryCLI.
|
|
4
|
+
*
|
|
5
|
+
* Measures CLI startup, build time, and test suite duration.
|
|
6
|
+
* Results saved to .orchestry/benchmarks/<timestamp>.json.
|
|
7
|
+
*
|
|
8
|
+
* Usage: npx tsx scripts/benchmark.ts
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { execSync } from 'node:child_process';
|
|
12
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
|
|
15
|
+
// ── Targets ──────────────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
const TARGETS: Record<string, number> = {
|
|
18
|
+
'cli-help': 50,
|
|
19
|
+
'cli-task-list': 100,
|
|
20
|
+
'build': 1500,
|
|
21
|
+
'test-suite': 12000,
|
|
22
|
+
'tick-cycle': 50,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// ── Types ────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
interface BenchmarkResult {
|
|
28
|
+
name: string;
|
|
29
|
+
runs: number[];
|
|
30
|
+
median: number;
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
target: number;
|
|
34
|
+
pass: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface BenchmarkReport {
|
|
38
|
+
timestamp: string;
|
|
39
|
+
node: string;
|
|
40
|
+
platform: string;
|
|
41
|
+
results: BenchmarkResult[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ── Helpers ──────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
function median(values: number[]): number {
|
|
47
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
48
|
+
const mid = Math.floor(sorted.length / 2);
|
|
49
|
+
return sorted.length % 2 === 0
|
|
50
|
+
? (sorted[mid - 1]! + sorted[mid]!) / 2
|
|
51
|
+
: sorted[mid]!;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function measure(cmd: string): number {
|
|
55
|
+
const start = performance.now();
|
|
56
|
+
execSync(cmd, { stdio: 'pipe', cwd: process.cwd() });
|
|
57
|
+
return Math.round(performance.now() - start);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function measureN(cmd: string, n: number): number[] {
|
|
61
|
+
const runs: number[] = [];
|
|
62
|
+
for (let i = 0; i < n; i++) {
|
|
63
|
+
runs.push(measure(cmd));
|
|
64
|
+
}
|
|
65
|
+
return runs;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function toBenchmarkResult(name: string, runs: number[], target: number): BenchmarkResult {
|
|
69
|
+
const med = median(runs);
|
|
70
|
+
return {
|
|
71
|
+
name,
|
|
72
|
+
runs,
|
|
73
|
+
median: med,
|
|
74
|
+
min: Math.min(...runs),
|
|
75
|
+
max: Math.max(...runs),
|
|
76
|
+
target,
|
|
77
|
+
pass: med <= target,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ── Benchmarks ───────────────────────────────────────────────
|
|
82
|
+
|
|
83
|
+
function benchCliHelp(): BenchmarkResult {
|
|
84
|
+
const runs = measureN('node dist/cli.js --help', 3);
|
|
85
|
+
return toBenchmarkResult('cli-help', runs, TARGETS['cli-help']!);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function benchCliTaskList(): BenchmarkResult {
|
|
89
|
+
const runs = measureN('node dist/cli.js task list', 3);
|
|
90
|
+
return toBenchmarkResult('cli-task-list', runs, TARGETS['cli-task-list']!);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function benchBuild(): BenchmarkResult {
|
|
94
|
+
const runs = [measure('npm run build')];
|
|
95
|
+
return toBenchmarkResult('build', runs, TARGETS['build']!);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function benchTestSuite(): BenchmarkResult {
|
|
99
|
+
const runs = [measure('npx vitest run')];
|
|
100
|
+
return toBenchmarkResult('test-suite', runs, TARGETS['test-suite']!);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function benchTickCycle(): Promise<BenchmarkResult> {
|
|
104
|
+
// Dynamic imports — only resolved when running via tsx
|
|
105
|
+
const { EventBus } = await import('../src/application/event-bus.js');
|
|
106
|
+
const { TaskService } = await import('../src/application/task-service.js');
|
|
107
|
+
const { AgentService } = await import('../src/application/agent-service.js');
|
|
108
|
+
const { RunService } = await import('../src/application/run-service.js');
|
|
109
|
+
const { AdapterRegistry } = await import('../src/infrastructure/adapters/registry.js');
|
|
110
|
+
const { Orchestrator } = await import('../src/application/orchestrator.js');
|
|
111
|
+
const { DEFAULT_CONFIG } = await import('../src/domain/config.js');
|
|
112
|
+
const { DEFAULT_STATE } = await import('../src/domain/state.js');
|
|
113
|
+
|
|
114
|
+
const TICK_RUNS = 100;
|
|
115
|
+
const config = { ...DEFAULT_CONFIG, scheduling: { ...DEFAULT_CONFIG.scheduling, poll_interval_ms: 999_999 } };
|
|
116
|
+
|
|
117
|
+
// Minimal in-memory mock stores
|
|
118
|
+
const taskStore = {
|
|
119
|
+
list: async () => Array.from({ length: 10 }, (_, i) => ({
|
|
120
|
+
id: `tsk_${i}`, title: `T${i}`, description: '', status: 'todo' as const,
|
|
121
|
+
priority: 2, labels: [], depends_on: [], created_at: '2025-01-01T00:00:00Z',
|
|
122
|
+
updated_at: '2025-01-01T00:00:00Z', attempts: 0, max_attempts: 3,
|
|
123
|
+
})),
|
|
124
|
+
get: async () => null,
|
|
125
|
+
save: async () => {},
|
|
126
|
+
delete: async () => {},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const agentStore = {
|
|
130
|
+
list: async () => Array.from({ length: 3 }, (_, i) => ({
|
|
131
|
+
id: `agt_${i}`, name: `A${i}`, adapter: 'shell', status: 'idle' as const,
|
|
132
|
+
config: { approval_policy: 'auto' as const, max_turns: 50, timeout_ms: 3_600_000, stall_timeout_ms: 300_000 },
|
|
133
|
+
stats: { tasks_completed: 0, tasks_failed: 0, total_runs: 0, total_runtime_ms: 0 },
|
|
134
|
+
})),
|
|
135
|
+
get: async () => null,
|
|
136
|
+
getByName: async () => null,
|
|
137
|
+
save: async () => {},
|
|
138
|
+
delete: async () => {},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const runStore = {
|
|
142
|
+
save: async () => {},
|
|
143
|
+
get: async () => null,
|
|
144
|
+
listForTask: async () => [],
|
|
145
|
+
listForAgent: async () => [],
|
|
146
|
+
appendEvent: async () => {},
|
|
147
|
+
readEvents: async () => [],
|
|
148
|
+
readEventsTail: async () => [],
|
|
149
|
+
streamEvents: async function* () {},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
let state = structuredClone(DEFAULT_STATE);
|
|
153
|
+
const stateStore = {
|
|
154
|
+
read: async () => structuredClone(state),
|
|
155
|
+
write: async (s: typeof state) => { state = structuredClone(s); },
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const eventBus = new EventBus();
|
|
159
|
+
const processManager = {
|
|
160
|
+
isAlive: () => false,
|
|
161
|
+
kill: () => {},
|
|
162
|
+
killWithGrace: async () => {},
|
|
163
|
+
spawn: () => ({ process: {} as ReturnType<typeof import('node:child_process').spawn>, pid: 1 }),
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const workspaceManager = {
|
|
167
|
+
prepare: async () => ({ path: '/tmp/ws' }),
|
|
168
|
+
mergeBack: async () => ({ success: true as const }),
|
|
169
|
+
cleanup: async () => {},
|
|
170
|
+
validate: () => {},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const templateEngine = { render: async () => 'prompt' };
|
|
174
|
+
const contextStore = {
|
|
175
|
+
get: async () => null, set: async () => {}, delete: async () => {},
|
|
176
|
+
list: async () => [], getAll: async () => ({}),
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const deps = {
|
|
180
|
+
taskStore, agentStore, runStore, stateStore,
|
|
181
|
+
adapterRegistry: new AdapterRegistry(),
|
|
182
|
+
workspaceManager, templateEngine, processManager,
|
|
183
|
+
eventBus,
|
|
184
|
+
taskService: new TaskService(taskStore, eventBus, config),
|
|
185
|
+
agentService: new AgentService(agentStore, stateStore, eventBus, config),
|
|
186
|
+
runService: new RunService(runStore, eventBus),
|
|
187
|
+
contextStore,
|
|
188
|
+
config,
|
|
189
|
+
projectRoot: '/tmp/bench',
|
|
190
|
+
lockPath: '/tmp/bench/.orchestry/lock',
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const orch = new Orchestrator(deps);
|
|
194
|
+
|
|
195
|
+
// Warm up: force internal state load
|
|
196
|
+
// Access private tick via bracket notation for benchmark purposes
|
|
197
|
+
const orchAny = orch as unknown as { tick(): Promise<void>; lockAcquired: boolean; state: typeof state };
|
|
198
|
+
orchAny.lockAcquired = true;
|
|
199
|
+
orchAny.state = structuredClone(DEFAULT_STATE);
|
|
200
|
+
|
|
201
|
+
const runs: number[] = [];
|
|
202
|
+
for (let i = 0; i < TICK_RUNS; i++) {
|
|
203
|
+
const start = performance.now();
|
|
204
|
+
await orchAny.tick();
|
|
205
|
+
runs.push(Math.round((performance.now() - start) * 100) / 100);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return toBenchmarkResult('tick-cycle', runs.map(Math.round), TARGETS['tick-cycle']!);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// ── Output ───────────────────────────────────────────────────
|
|
212
|
+
|
|
213
|
+
function printTable(results: BenchmarkResult[]): void {
|
|
214
|
+
const nameW = 16;
|
|
215
|
+
const colW = 10;
|
|
216
|
+
|
|
217
|
+
const header = [
|
|
218
|
+
'Benchmark'.padEnd(nameW),
|
|
219
|
+
'Median'.padStart(colW),
|
|
220
|
+
'Min'.padStart(colW),
|
|
221
|
+
'Max'.padStart(colW),
|
|
222
|
+
'Target'.padStart(colW),
|
|
223
|
+
'Status'.padStart(colW),
|
|
224
|
+
].join(' ');
|
|
225
|
+
|
|
226
|
+
const sep = '─'.repeat(header.length);
|
|
227
|
+
|
|
228
|
+
console.log(`\n${sep}`);
|
|
229
|
+
console.log(header);
|
|
230
|
+
console.log(sep);
|
|
231
|
+
|
|
232
|
+
for (const r of results) {
|
|
233
|
+
const status = r.pass ? 'PASS' : r.median <= r.target * 1.2 ? 'NEAR PASS' : 'FAIL';
|
|
234
|
+
const line = [
|
|
235
|
+
r.name.padEnd(nameW),
|
|
236
|
+
`${r.median}ms`.padStart(colW),
|
|
237
|
+
`${r.min}ms`.padStart(colW),
|
|
238
|
+
`${r.max}ms`.padStart(colW),
|
|
239
|
+
`${r.target}ms`.padStart(colW),
|
|
240
|
+
status.padStart(colW),
|
|
241
|
+
].join(' ');
|
|
242
|
+
console.log(line);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
console.log(sep);
|
|
246
|
+
|
|
247
|
+
const allPass = results.every((r) => r.pass);
|
|
248
|
+
console.log(allPass ? '\nAll benchmarks PASS' : '\nSome benchmarks FAIL');
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function saveReport(report: BenchmarkReport): string {
|
|
252
|
+
const dir = join(process.cwd(), '.orchestry', 'benchmarks');
|
|
253
|
+
mkdirSync(dir, { recursive: true });
|
|
254
|
+
const filename = `${report.timestamp.replace(/[:.]/g, '-')}.json`;
|
|
255
|
+
const filepath = join(dir, filename);
|
|
256
|
+
writeFileSync(filepath, JSON.stringify(report, null, 2) + '\n');
|
|
257
|
+
return filepath;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// ── Main ─────────────────────────────────────────────────────
|
|
261
|
+
|
|
262
|
+
async function main(): Promise<void> {
|
|
263
|
+
console.log('Running benchmarks...\n');
|
|
264
|
+
|
|
265
|
+
// Ensure build exists for CLI benchmarks
|
|
266
|
+
try {
|
|
267
|
+
execSync('node dist/cli.js --version', { stdio: 'pipe' });
|
|
268
|
+
} catch {
|
|
269
|
+
console.log('Building first (dist/ not ready)...');
|
|
270
|
+
execSync('npm run build', { stdio: 'inherit' });
|
|
271
|
+
console.log('');
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const results: BenchmarkResult[] = [];
|
|
275
|
+
|
|
276
|
+
console.log('[1/5] CLI --help (3 runs)');
|
|
277
|
+
results.push(benchCliHelp());
|
|
278
|
+
|
|
279
|
+
console.log('[2/5] CLI task list (3 runs)');
|
|
280
|
+
results.push(benchCliTaskList());
|
|
281
|
+
|
|
282
|
+
console.log('[3/5] Build');
|
|
283
|
+
results.push(benchBuild());
|
|
284
|
+
|
|
285
|
+
console.log('[4/5] Test suite');
|
|
286
|
+
results.push(benchTestSuite());
|
|
287
|
+
|
|
288
|
+
console.log('[5/5] Tick cycle (100 runs)');
|
|
289
|
+
results.push(await benchTickCycle());
|
|
290
|
+
|
|
291
|
+
const report: BenchmarkReport = {
|
|
292
|
+
timestamp: new Date().toISOString(),
|
|
293
|
+
node: process.version,
|
|
294
|
+
platform: `${process.platform}-${process.arch}`,
|
|
295
|
+
results,
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
printTable(results);
|
|
299
|
+
|
|
300
|
+
const filepath = saveReport(report);
|
|
301
|
+
console.log(`\nSaved: ${filepath}`);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
main();
|