Skip to content

perf(compiler): share distinct interface async edges - #215

Merged
paralin merged 1 commit into
masterfrom
perf/async-edges
Oct 7, 2026
Merged

paralin merged 1 commit into
masterfrom
perf/async-edges

Conversation

@paralin

@paralin paralin commented Oct 7, 2026

Copy link
Copy Markdown
Member

Interface async coloring built one mark per implementation and interface method pair, 3.9 million marks over 62,690 distinct edges on the Spacewave tree. The compiler now builds the distinct edges once per implementation and coloring reads them directly, so the flat mark slice and its second indexing pass are gone. A leaf edit on the Spacewave tree compiles in 1.951 s instead of 2.127 s on a quiet host, and a cold compile of the 13 patterns produces byte-identical output.

…struction and coloring

Build the adjacency from each implementation to the interface methods it
colors once, skipping repeated edges as they appear, and let coloring read
that relation instead of rebuilding it from a flat slice of every mark.

Signed-off-by: Christian Stewart <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The refactor preserves existing propagation semantics while removing redundant marks and indexing.

0 open findings

What changed in this PR

This PR reduces memory and indexing overhead during interface async coloring by sharing distinct implementation-to-interface edges.

Changes:

  • Deduplicates interface async edges during semantic model construction.
  • Lets async coloring consume the shared edge map directly.
File Description
compiler/​semantic-model.go Builds distinct async interface edges.
compiler/​semantic-async.go Defines and consumes the shared edge map.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@paralin
paralin merged commit cdfe04b into master Oct 7, 2026
10 checks passed
@paralin
paralin deleted the perf/async-edges branch October 7, 2026 23:16
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.

2 participants