{"draft":null,"from":273,"to":274,"files":[{"path":"worker/project/definition-code.ts","added":9,"removed":1,"diff":"--- a/worker/project/definition-code.ts\n+++ b/worker/project/definition-code.ts\n@@ -2,11 +2,19 @@\n import { StoredText } from \"../../src/engine/stored-text.ts\";\n import { eachCodeLine } from \"./names.ts\";\n \n+/**\n+ * Characters of parsed code kept in memory before the rest goes to scratch (abso Capacity). The visible lines it is\n+ * parsed from are already in memory, so this at most doubles a file's text for the call; at 64 KB, every large file's\n+ * code went row by row into scratch and back, 25,000 rows each for abso's index.ts, a third of a cold collisions call.\n+ */\n+export const DEFINITION_CODE_IN_MEMORY = 4_000_000;\n+\n /** Parsed code is temporary derived data, discarded with the scratch transaction. */\n export function withDefinitionCode<T>(\n \tview: ReadView,\n \tvisible: readonly VisibleLine[],\n \toperation: (code: readonly string[]) => T,\n+\tinMemory = DEFINITION_CODE_IN_MEMORY,\n ): T {\n \tfunction* source() {\n \t\tfor (const line of visible) yield line.text;\n@@ -16,7 +24,7 @@\n \tlet prefix: string[] = [];\n \tlet size = 0;\n \tlet pending = iterator.next();\n-\twhile (!pending.done && size + pending.value.length + 1 <= 65536) {\n+\twhile (!pending.done && size + pending.value.length + 1 <= inMemory) {\n \t\tprefix.push(pending.value);\n \t\tsize += pending.value.length + 1;\n \t\tpending = iterator.next();"}],"unmatched":[]}