Versions 68 to 318
new file, 123 lines
1+// Time and memory of a local project's commands (abso init --local) on a small and a large history:
5+// Each history is built in this process through the client's main(); then every command is run as its own
6+// `node client/abso.ts` process, the way a person or an agent runs it, five times. It prints the median and slowest
8+
15+
20+
23+
33+
36+ i === version % 30 ? `line ${i} of file ${file}, version ${version}` : `line ${i} of file ${file}`,
40+
61+
62+function measure(cwd: string, store: string, argv: string[]): { median: number; slowest: number; rss: number } {
69+ `import { writeFileSync } from "node:fs";\nprocess.on("exit", () => writeFileSync(${JSON.stringify(out)}, String(process.resourceUsage().maxRSS)));\n`,
73+ const r = spawnSync(process.execPath, ["--import", pathToFileURL(preload).href, ENTRY, ...argv], {
79+ if (r.status !== 0 && argv[0] !== "push") throw new Error(`${argv.join(" ")}: ${r.stdout}${r.stderr}`);
94+
98+ `Node ${process.versions.node}, ${FILES} files of 30 lines, three files changed per version, ${RUNS} runs each.`,
113+ if (argv[0] === "push") writeFileSync(join(cwd, "f1.txt"), lines(1, versions + Math.random()));
116+ `${String(versions).padStart(5)} v | ${name.padEnd(20)} | ${ms(m.median).padStart(8)} | ${ms(m.slowest).padStart(8)} | ${kb(m.rss)}`,
120+ `${String(versions).padStart(5)} v | store on disk ${(sizeOf(store) / 1048576).toFixed(1)} MB, built in-process in ${(built / 1000).toFixed(1)} s`,
122+ for (const d of [store, alice, bob]) rmSync(d, { recursive: true, force: true, maxRetries: 5 });
- MCP
- compare on this site's /mcp
- CLI
- abso diff 68 318 scripts/local-measure.ts --json
- JSON
- /christopher/abso-core/compare/68..318?file=scripts%2Flocal-measure.ts&format=json