Versions 175 to 318
Lines 12–107 at 318 (were 12–47 at 175)
1414
16+ * At most this many views (abso Capacity). where visits every agent's draft view in turn: with more agents than views,
17+ * each visit evicted the next one, and a warm where on abso laid every view out again (4.5 s against 0.33 s). The byte
21+
1926
20−/** Views by key, most recently used last, held under VIEW_BUDGET bytes and 32 views. */
2532
26− constructor(graph: Graph, provider?: (graph: Graph) => ReadViewProvider) {
35+ constructor(graph: Graph, provider?: (graph: Graph) => ReadViewProvider, budget = VIEW_BUDGET) {
3343
45+ * Weigh every cached view again and evict until they fit (abso Capacity): views grow while a call lays files out,
55+
57+ * Let go of the least recently used file layouts across every view, until about `over` bytes are freed (abso
58+ * Capacity). Evicting whole views dropped layouts just made along with old ones: compare 612 to 1224 on abso needs
59+ * both versions' layouts, about 25 MB, and evicting one whole after the call meant asking again laid it all out again.
63+ // One entry per layout: a layout several views hold (a draft's view borrows its base's) is used as recently as
65+ const layouts = new Map<object, { used: number; bytes: number; holders: { view: View; path: string }[] }>();
72+ } else layouts.set(f.layout, { used: f.used, bytes: f.bytes, holders: [{ view, path: f.path }] });
81+
37− * large generated file add up. At most 32.
88+ // The newest views that fit, as evicting oldest first leaves them. A file layout two views share (a draft's view
89+ // takes its base's, View.shareFiles) counts once (abso Capacity): counted per view, they filled the budget twice
41− for (const v of this.#cache.values()) total += v.weight();
42− for (const [key, v] of this.#cache) {
43− if (total <= VIEW_BUDGET && this.#cache.size <= 32) break;
44− total -= v.weight();
- MCP
- compare on this site's /mcp
- CLI
- abso diff 175 318 worker/project/views.ts --json
- JSON
- /christopher/abso-core/compare/175..318?file=worker%2Fproject%2Fviews.ts&format=json