Versions 199 to 200
Lines 46–51 at 200 (were 46–52 at 199)
49− readonly atCache: Map<number, ReadonlySet<AtomId>>;
5049 /** For a named draft, the log position of the entry that made it: the change its work belongs to (#44). */
Lines 61–69 at 200 (were 62–71 at 199)
65− atCache: new Map(),
68− return { name, versions: [], own: new Set(), publishedIn: new Map(), droppedIn: new Map(), atCache: new Map() };
7068
Lines 202–231 at 200 (were 204–213 at 199)
206204
206+ * How many built membership sets the in-memory path keeps, across every space (abso Capacity). Each named draft's set
207+ * is a whole copy of shared's at its base plus its own atoms, so a cache per space held one copy of shared per draft:
208+ * on prod project abso, 106 drafts kept 37 MB of them. One least-recently-used cache holds at most this many; a set
209+ * that fell out is built again when asked for, in milliseconds at that size. Measured on abso's prod export (81,855
210+ * entries): 96.6 MB after load before, 64.6 MB with 16 kept, 62.0 MB with 8; 16 keeps the load as fast as before.
213+
214+/** A number per space object, so a space replaced under the same name (tables/build.ts) never gets the old one's sets. */
222+
Lines 368–393 at 200 (were 350–367 at 199)
353− let set = space.atCache.get(version);
354− if (!set) {
355− const s = new Set<AtomId>();
356− if (space.name !== SHARED) for (const id of this.at(this.shared, space.versions[version]!.sharedBase!)) s.add(id);
357− for (let v = 0; v <= version; v++) {
358− for (const id of space.versions[v]!.atoms) s.add(id);
359− for (const id of space.versions[v]!.dropped ?? []) s.delete(id);
360− }
361− set = s;
362− if (space.atCache.size > 16) space.atCache.clear();
363− space.atCache.set(version, set);
365− return set;
379+ if (space.name !== SHARED) for (const id of this.at(this.shared, space.versions[version]!.sharedBase!)) s.add(id);
385+ if (this.#sets.size > MEMBERSHIP_SETS_KEPT) this.#sets.delete(this.#sets.keys().next().value!);
388+
- MCP
- compare on this site's /mcp
- CLI
- abso diff 199 200 worker/project/spaces.ts --json
- JSON
- /christopher/abso-core/compare/199..200?file=worker%2Fproject%2Fspaces.ts&format=json