GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — opencode/script/profile-typecheck-packages.ts at dev · carllewis/opencode Expand file tree/ Copy pathprofile-typecheck-packages.tsMore file actions 66 lines (61 loc) · 1.86 KB / Copy pathprofile-typecheck-packages.tsFile metadata and controls66 lines (61 loc) · 1.86 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 #!/usr/bin/env bun import path from "path" const root = path.resolve(import.meta.dir, "..") const proc = Bun.spawn( [ "bun", "turbo", "typecheck", "--concurrency=1", "--force", "--continue=always", "--summarize", "--output-logs=errors-only", ], { cwd: root, stdout: "pipe", stderr: "pipe", }, ) const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]) const output = stdout + stderr if (exitCode !== 0) { process.stdout.write(stdout) process.stderr.write(stderr) process.exit(exitCode) } const summary = output.match(/Summary:\s+(.+\.json)/)?.[1]?.trim() if (!summary) { process.stdout.write(stdout) process.stderr.write(stderr) throw new Error("Turbo did not report a run summary") } const report = (await Bun.file(summary).json()) as { tasks: Array<{ taskId: string execution: { startTime: number; endTime: number; exitCode: number } | null }> } const tasks = report.tasks .flatMap((task) => task.execution ? [ { task: task.taskId.replace(/#typecheck$/, ""), durationMs: task.execution.endTime - task.execution.startTime, }, ] : [], ) .sort((a, b) => b.durationMs - a.durationMs) const total = tasks.reduce((duration, task) => duration + task.durationMs, 0) const width = Math.max(...tasks.map((task) => task.task.length), "Package".length) console.log(`Package${" ".repeat(width - "Package".length)} Time Share`) tasks.forEach((task) => { const duration = `${(task.durationMs / 1000).toFixed(2)}s`.padStart(7) const share = `${((task.durationMs / total) * 100).toFixed(1)}%`.padStart(6) console.log(`${task.task.padEnd(width)} ${duration} ${share}`) }) console.log(`\nTotal serial task time: ${(total / 1000).toFixed(2)}s`) console.log(`Turbo summary: ${path.relative(root, summary)}`) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |