perf(onset): a busy project lands through a front, and compacts in a second
Radin committed
- Author
- Radin · radin@coline.appOct 31, 2026 at 23:34
- Committer
- Radin · radin@coline.appOct 31, 2026 at 23:34
- Parents
- ae5b7e7efe03
perf(onset): a busy project lands through a front, and compacts in a second One project topped out near 200 lands a second, with answers held for seconds. What it was: - Every call into a project costs it about 1.5 ms however little it carries, and the Worker's many instances each brought two or so lands. A project landing over 50 a second now has its landings come through its front (front.ts, a Durable Object that stores nothing, made next to the project): it gathers every instance's landings into calls of 15 to 60. Below that, lands go straight to the project as before. - Reading small objects asked for pack = '' AND id IN (...), which SQLite answered from the pack index, reading every inline object for each batch of 100. Compaction read 8 MB that way (4.4 s of CPU) and moved it a row per statement (8.7 s), holding every answer up meanwhile. Reads now go by ID and moves take 33 rows a statement: 13 s to 0.5 s. - A land wrote 20 statements; now 6. Its objects are held in memory and written with its version in one transaction, the edit key is a column of the change, and the byte counts are written every couple of seconds (counted again daily). Perf copy, one project, 256 agents: 200 to 340-470 lands a second, p99 3-12 s to 1.4-1.6 s. load.mjs --fanout spreads agents' files over folders; ONSET_FRONT_AT=0 runs the Worker suite with every landing through the front. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed+10−5