Skip to content

resolver: log per-sub-pass timing for the attribution sweep#268

Merged
zzet merged 1 commit into
mainfrom
perf/go-attribution-cost
Jul 8, 2026
Merged

resolver: log per-sub-pass timing for the attribution sweep#268
zzet merged 1 commit into
mainfrom
perf/go-attribution-cost

Conversation

@zzet

@zzet zzet commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #267's framework-dispatch-synthesis investigation — checked whether go_attribution (the other large chunk of resolve_s on a real multi-repo cold start, ~66-100s) had the same class of bug (an unscoped AllEdges()/AllNodes() scan instead of a kind-scoped query).

It doesn't. Instrumented all 6 attribution sub-passes and measured against a snapshot of a real 26-repo store: no sub-pass dominates (9-15s each), and every one already uses EdgesByKind/NodesByKind (SQL-side kind filter), several with comments noting that choice was deliberate.

This PR is logging only: per-sub-pass timing on the existing resolver: pass complete line, so a future regression here has a breadcrumb instead of hiding behind one aggregate duration (the same value framework-dispatch-synthesis's timing already provides).

Follow-up investigation (lang_dispatch_reconcile's own sub-passes, plus a real finding and a reverted regression in EdgesWithUnresolvedTarget) continues in #269.

Test plan

  • GOWORK=off go build ./...
  • GOWORK=off go test -race ./internal/resolver/... ./internal/indexer/...

runFileAttributionPassesLocked ran six binding passes
(rebindGoMethodReceivers, bindBareNameScopeRefs, bindDataflowCalleeRefs,
bindGenericParamRefs, attributeGoBuiltins, attributeGoExternalCalls) as
one opaque duration in the existing "resolver: pass complete" log line.
Break it out per sub-pass, matching the framework-synthesizer timing
added earlier, so a future single-pass regression here has a
breadcrumb instead of hiding behind one aggregate number.

Measured on a 26-repo real-store snapshot: no sub-pass dominates (9-15s
each of ~66s combined) and none scans the graph unscoped — every pass
already uses a kind-scoped EdgesByKind/NodesByKind query, several with
comments noting that choice was deliberate. This is logging only; no
behavior change.
@zzet zzet merged commit 7517f75 into main Jul 8, 2026
9 checks passed
@zzet zzet deleted the perf/go-attribution-cost branch July 8, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant