Versions 285 to 318
Lines 31–39 at 318 (were 31–36 at 285)
34+ // Local projects run the open server's code in the client (client/src/local-store.ts); its Durable Object
3437 // A bundled CommonJS package (yaml) calls require("process") lazily, which an ES module bundle
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 });
new file, 87 lines
1+// A local project's store lock under load: 1, 4 and 16 writers pushing to one local project at once.
5+// Each writer is its own agent, in its own folder, changing its own file, so nothing collides: what's measured is the
6+// store's lock (one SQLite write transaction per call). Every push is its own `node client/abso.ts push` process, as
7+// an agent runs it. It prints each push's wall time (median, 95th percentile, slowest), the pushes per second across
9+
16+
21+
22+function push(cwd: string, store: string, message: string): Promise<{ ms: number; ok: boolean; out: string }> {
39+
40+const pct = (sorted: number[], p: number) => sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * p))]!;
41+console.log(`Node ${process.versions.node}, ${PUSHES} pushes per writer, each writer its own agent and file.`);
49+ const init = await main(["init", "--local", "--project", "writers", "--agent", "w0", "--as-is"], {
83+ `${String(writers).padStart(7)} | ${String(times.length).padStart(6)} | ${ms(pct(times, 0.5))} | ${ms(pct(times, 0.95))} | ${ms(times.at(-1)!)} | ${(times.length / total).toFixed(1).padStart(8)} | ${failures.length}`,
86+ for (const d of [store, ...folders]) rmSync(d, { recursive: true, force: true, maxRetries: 5 });
- MCP
- compare on this site's /mcp
- CLI
- abso diff 285 318 scripts --json
- JSON
- /christopher/abso-core/compare/285..318?file=scripts&format=json