feat: python scripting phase 0

This commit is contained in:
2026-02-22 21:29:16 +01:00
parent d7c97f4d85
commit ce050f98c3
12 changed files with 895 additions and 11 deletions

View File

@@ -0,0 +1,28 @@
import { runPythonRuntimeBenchmark } from '../src/renderer/python/pythonRuntimeBenchmark';
async function main(): Promise<void> {
const iterationsArg = process.argv[2];
const iterations = iterationsArg ? Number(iterationsArg) : 200;
if (!Number.isInteger(iterations) || iterations <= 0) {
throw new Error('Iterations must be a positive integer');
}
const result = await runPythonRuntimeBenchmark({ iterations });
const output = {
measuredAt: new Date().toISOString(),
iterations,
coldStartMs: result.coldStartMs,
warmRunMs: result.warmRunMs,
repeatedMacro: result.repeatedMacro.stats,
};
console.log(JSON.stringify(output, null, 2));
}
void main().catch((error: unknown) => {
const message = error instanceof Error ? error.message : String(error);
console.error(`[python-runtime-benchmark] ${message}`);
process.exit(1);
});