Versions 263 to 318
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 263 318 scripts/local-writers.ts --json
- JSON
- /christopher/abso-core/compare/263..318?file=scripts%2Flocal-writers.ts&format=json