perf: parallel blame, parallel link checks, overlapped startup#26
Merged
laulauland merged 1 commit intomainfrom Apr 17, 2026
Merged
perf: parallel blame, parallel link checks, overlapped startup#26laulauland merged 1 commit intomainfrom
laulauland merged 1 commit intomainfrom
Conversation
8dde3c3 to
a70d084
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three additional concurrency layers in
src/commands/lint.zig, all stacked on the per-docIo.Groupparallelism from #24. Fully documented indocs/CONCURRENCY.md.Changes
Layer 2: per-binding parallel blame (
io.async).checkBindingno longer shells out togit loginline. A new phase incheckOneDocInnerspawns oneio.async(vcs.getLatestBlameInfo, …)future perchanged_after_baselinestale anchor, then awaits all of them and fills in the blame info on the anchor rows. A doc with 5 stale anchors previously ran 5 sequentialgit logcalls; now they run concurrently on the thread pool.Note: blame is fired after staleness is confirmed, not speculatively. Speculative blame on fresh anchors would cost ~20 ms per fresh anchor (typical
git log -1latency) to save ~15 ms per stale one — net negative in the common case where most anchors are fresh.Layer 3: per-link parallel existence checks (
Io.Group).checkDocLinksnow spawns one task per markdown link, each doingrealPathFileAlloc+accessAbsolute. Results fill pre-allocated?JsonLinkRowslots and are appended in doc-order aftergroup.await.Io.Batchwas evaluated and rejected because itsOperationunion doesn't include stat/access ops in Zig 0.16.Layer 4: overlapped startup (
io.async).vcs.getRepoIdentitynow runs as anio.asyncfuture in parallel withdiscoverDocGroups. Two independentgitsubprocesses execute concurrently. Small absolute win, but free.Testing
zig buildpasseszig build testpasses: 63 tests, 0 failuresdrift checkoutput byte-identical to sequential baseline (same docs, same blame info, same sort order)Docs
docs/CONCURRENCY.mdreplaces the "proposed future work" sections with the actual implementation, keeps the rationale for why speculative blame was rejected, and notes one remaining proposal (persistentGitCatFilerequest/response pipelining) that doesn't match any current use case.