Lines 10–16 at 318 (were 10–16 at 293)
1010// made when a caller asks for them, and the latest asked for is kept. 1212import type { Graph, RelocationInfo } from "./graph.ts"; 13−import { isStartNode, lineId, seqOf } from "./keys.ts";
13+import { atomId, isStartNode, lineId, seqOf } from "./keys.ts"; 1414import { resolveScratchMoves, scratchLayoutNodes } from "./relocation-scratch.ts"; 1515import { isClosedSet, StableSet } from "./state-source.ts"; 1616import { joinLines } from "./text.ts"; Lines 1095–1108 at 318 (were 1095–1101 at 293)
10971097 *lineChunks(path: string): IterableIterator<() => Iterable<string>> { 1098− for (const n of this.#file(path).vis) yield () => this.graph.textChunks(n);
1098+ // The texts the packed layout already holds, read a page at a time (abso Capacity, 714): a record's diff read each 1099+ // line's own row, 11,873 statements for abso's index.ts. Only a line too long to pack is read in chunks. 1100+ const { vis, visText } = this.#file(path); 1101+ for (let i = 0; i < vis.length; i++) { 1102+ const packed = visText?.[i]; 1103+ if (packed != null) yield () => [packed]; 1104+ else yield () => this.graph.textChunks(vis[i]!); 11011108 /** Visible lines without retaining their text in the view cache. */ Lines 1112–1118 at 318 (were 1105–1111 at 293)
11061113 id: graph.lineIdOf(n), 11071114 text: graph.textOf(n), 1108− atom: graph.idOfSeq(graph.writerSeqOf(n)),
1115+ atom: atomId(graph.writerSeqOf(n)), Lines 1126–1137 at 318 (were 1119–1130 at 293)
11191126 const n = vis[i]!; 11201127 const packed = visText?.[i]; 1122− id: visWriter && visK ? lineId(graph.idOfSeq(visWriter[i]!), visK[i]!) : graph.lineIdOf(n),
1129+ id: visWriter && visK ? lineId(atomId(visWriter[i]!), visK[i]!) : graph.lineIdOf(n), 11231130 textChunks: () => graph.textChunks(n), 11251132 return packed ?? graph.textOf(n); 1127− atom: graph.idOfSeq(visWriter ? visWriter[i]! : graph.writerSeqOf(n)),
1134+ atom: atomId(visWriter ? visWriter[i]! : graph.writerSeqOf(n)), Lines 1143–1156 at 318 (were 1136–1147 at 293)
11361143 const graph = this.graph; 11371144 const { vis, visText, visWriter, visK } = this.#file(path); 11381145 const lines: VisibleLine[] = new Array(vis.length); 1146+ // Writer seqs come from the graph's own layout, so they're named with atomId, not checked by idOfSeq (abso 738): 1147+ // on a stored graph its check read the atom count once a line, about 0.9 s of a warm draft-state on abso. 11391148 for (let i = 0; i < vis.length; i++) { 11401149 const n = vis[i]!; 1142− id: visWriter && visK ? lineId(graph.idOfSeq(visWriter[i]!), visK[i]!) : graph.lineIdOf(n),
1151+ id: visWriter && visK ? lineId(atomId(visWriter[i]!), visK[i]!) : graph.lineIdOf(n), 11431152 text: visText?.[i] ?? graph.textOf(n), 1144− atom: graph.idOfSeq(visWriter ? visWriter[i]! : graph.writerSeqOf(n)),
1153+ atom: atomId(visWriter ? visWriter[i]! : graph.writerSeqOf(n)), 11471156 this.#linesCache = { path, lines }; Lines 1172–1184 at 318 (were 1163–1175 at 293)
11631172 const writer = seqWriter ? seqWriter[i]! : graph.writerSeqOf(n); 11641173 let text: string | undefined; 1166− id: seqWriter && seqK ? lineId(graph.idOfSeq(writer), seqK[i]!) : graph.lineIdOf(n),
1175+ id: seqWriter && seqK ? lineId(atomId(writer), seqK[i]!) : graph.lineIdOf(n), 11681177 text ??= graph.textOf(n); 1171− atom: graph.idOfSeq(writer),
1172− deletedBy: by ? by.map((s) => graph.idOfSeq(s)) : NONE,
1180+ atom: atomId(writer), 1181+ deletedBy: by ? by.map((s) => atomId(s)) : NONE, 11731182 visible: by === undefined,