perf(graph): single-pass index parse + unpinned backlink context & release v2.2.2 #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/index-build-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two behavior-preserving index-build optimizations (cut v2.2.2).
Single-pass parse.
BuildIndex's second pass split each page into lines 3× — once for context lookup, once inExtractWikiLinks, once inExtractTodos— and re-walked the fence state in each extractor. Folded into oneparseBodythat walks the lines once and returns(lines, links, todos);BuildIndexreuses the returned lines for context. Added astrings.Contains(line, "[[")fast-path so link-free lines skip the backtick split + regex.ExtractWikiLinks/ExtractTodoskept as thin wrappers — public API and tests unchanged.Unpinned context.
strings.Splitlines are substrings sharing the whole body's backing array, so a retainedRef.Contextpinned the entire file body in memory for the life of the index.lineContextnowstrings.Clones the line so it owns its bytes. Pinned by a newTestLineContextDoesNotPinFileBody(watched fail → pass).Full suite + vet + gofmt green.
perf(graph): single-pass index parse + unpinned backlink contextto perf(graph): single-pass index parse + unpinned backlink context & release v2.2.2